Files
node/lib/internal
Jan Krems 71bcd05232 module: resolve self-references
Adds the ability to `import` or `require` a package from within its
own source code. This allows tests and examples to be written using
the package name, making them easier to reuse by consumers of the
package.

Assuming the `name` field in `package.json` is set to `my-pkg`, its
test could use `require('my-pkg')` or `import 'my-pkg'` even if
there's no `node_modules/my-pkg` while testing the package itself.

An important difference between this and relative specifiers like
`require('../')` is that self-references use the public interface
of the package as defined in the `exports` field while relative
specifiers don't.

This behavior is guarded by a new experimental flag
(`--experimental-resolve-self`).

PR-URL: https://github.com/nodejs/node/pull/29327
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-10-24 15:14:38 -07:00
..
2019-10-01 21:13:53 +02:00
2019-10-15 22:19:16 -07:00
2019-10-16 21:50:05 -04:00
2019-10-24 15:14:38 -07:00
2019-09-18 16:09:20 -05:00
2019-10-14 14:25:38 -07:00
2019-06-27 11:57:19 +02:00
2019-10-08 10:34:48 -07:00
2019-04-11 05:40:59 +02:00
2019-08-19 12:56:08 -07:00
…
2019-10-02 16:17:01 -07:00

Internal Modules

The modules in lib/internal are intended for internal use in Node.js core only, and are not accessible with require() from user modules. These modules can be changed at any time. Reliance on these modules outside of core is not supported in any way.