1.1.0 • Published 4 years ago

alanode v1.1.0

Weekly downloads
4
License
MIT
Repository
gitlab
Last release
4 years ago

alanode

npm version

alanode is The Binary To Run Node.JS Files With Import And Export Statements.

yarn add -DE alanode # project-based
yarn global add alanode # user-based

Table Of Contents

CLI

The package can be run from the CLI:

$ alanode source

It uses ÀLaMode regex-based transpiler to change import and export statements into require calls and module.export expressions (no Babel). It also normalises process.argv to hide its presence, so that programs can safely keep using the argv array without unexpected results.

With the following file that uses an import:

import { constants } from 'os'
console.log(process.argv)
console.log(constants.signals.SIGINT)

$ alanode t will generate the result successfully:

[
  '/Users/anton/.nvm/versions/node/v12.14.1/bin/node',
  '/Users/anton/a-la/alanode/test/fixture/t'
]
2

Copyright

(c) À La Mode 2019