alias-register

0.2.0 • Public • Published

alias-register

Version

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

Readme

Keywords

none

Package Sidebar

Install

npm i alias-register

Weekly Downloads

4

Version

0.2.0

License

none

Unpacked Size

14.4 kB

Total Files

7

Last publish

Collaborators

  • sooniter