notes/node/gate-reference.md
Smaller Node gates that tsx forwards or mirrors, but that do not need a full mechanism story.
| Gate | Section |
|---|---|
importAttributes | Import attributes |
importMetaPathProperties | import.meta path properties |
wasmModules | WASM modules |
modulePackageMainResolution | legacyMainResolve assertion fix |
cliTestFlag | --test flag |
testRunnerGlob | Test runner glob |
importAttributes)import … with { type: 'json' } (import attributes), succeeding the earlier assert { … } assertions syntax. The load path aliases legacy assertions into attributes at v20.10.0 load.js#L116-L124, and validation checks the type attribute in assert.js#L57-L80.src/esm/hook/load.ts picks the importAttributes vs legacy importAssertions context property accordingly.import.meta path properties (importMetaPathProperties)import.meta.dirname and import.meta.filename. Node initializes them from the file URL path at v20.11.0 initialize_import_meta.js#L61-L62 and v21.2.0 initialize_import_meta.js#L61-L62.src/utils/transform/index.ts injects dirname/filename only where Node exposes them, avoiding a transformed-CJS shape that diverges from Node.wasmModules)import of .wasm modules. The import-attributes validator treats wasm as an implicit type at v22.19.0 assert.js#L32 and v24.5.0 assert.js#L32.wasmModules gate.legacyMainResolve assertion fix (modulePackageMainResolution)main resolution (legacyMainResolve) threw on certain inputs; fixed for the 18.x line. The resolver entry is v18.20.4 resolve.js#L176, called from package resolution at resolve.js#L903. v18.20.5 keeps the same public shape (resolve.js#L176, resolve.js#L903) but fixes the internal assertion; newer lines never had the broken assertion.modulePackageMainResolution gate.--test flag (cliTestFlag)--test only where supported.testRunnerGlob)