Closed Semigradsky closed 8 years ago
It will be nice to have.
I'm not sure how to implement it ...
I can think of two ways:
index.ts
inspect process.argv
searching parameters ...cli.ts
that import and use bundle
function from index.ts
...@basarat can you tell me about?
I not sure how to determine if a module is running directly with nodejs or included from other ...
I not sure how to determine if a module is running directly with nodejs or included from other
With examples :
bin
in package.json : https://github.com/alm-tools/alm/blob/master/package.json#L7 pointing to a js file which can then safely assume that it is being run as an executable. #! /usr/bin/env node
https://github.com/alm-tools/alm/blob/master/bin/almnpm install -g alm
. This gives them the executables from the package.json bin
on the user system command line scripts
option in package.json to drive it e.g. : "scripts": {
"build": "alm -p ./src"
},
:rose:
Done.
Running using npm script would be very convenient