0.2.0 • Published 2 months ago

alias-register v0.2.0

Weekly downloads
-
License
-
Repository
github
Last release
2 months ago

alias-register

Get Started

// alias.config.cjs
const path = require('path');

const config = {
  resolve: {
    alias: {
      lib: path.join(__dirname, 'lib'),
    },
  },
};

module.exports = config;
node --import alias-register ./main.js

ESM only loader

If you only need to add TypeScript support in a Module context, you can use the ESM loader:

Node.js v20.6.0 and above
node --import alias-register/esm ./main.js
Node.js v20.5.1 and below
node --loader alias-register/esm ./main.js

CommonJS only loader

If you only need to add TypeScript & ESM support in a CommonJS context, you can use the CJS loader:

node --require alias-register/cjs ./main.js
0.2.0

2 months ago

0.1.0

2 months ago