alanode
v1.1.0
Published
The Binary To Run Node.JS Files With Import And Export Statements.
Downloads
34
Maintainers
Readme
alanode
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