alanode

1.1.0 • Public • Published

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

Package Sidebar

Install

npm i alanode

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

4.43 kB

Total Files

7

Last publish

Collaborators

  • zvr