A tiny example would be the following:
package.json: { "dependencies": { "nodejs.jsx": "~ 0.1.1" } } hello-npm.jsx: import "nodejs.jsx/*.jsx"; class _Main { static function main(args : string[]) : void { fs.appendFileSync("/dev/fd/1", "hello npm!\n"); } }
Running
npm install
would install nodejs.jsx (JSX binding for node.js) which is specified as a dependency in package.json
. And when the compiler is executed (e.g. jsx hello-npm.jsx
) it would automatically search for the imported files and use them in the node_modules
directory.For the time being, file specified in the
main
section of package.json
is used if the name of a module is an argument to the import statement (e.g. import "npm-module-name"
). Or the directory designated by the dependencies
/lib
section is searched if a file within an npm module is specified (e.g. import "npm-module-name/filename"
).If you have any comments / suggestions please file a issue at the GitHub issues page.
Interesting Article
ReplyDeleteJavascript Training in Chennai | HTML5 Online Training | JavaScript Online Training
Javascript Training Courses | Javascript Online Training
ReplyDeleteGreat Article
ReplyDeleteB.Tech Final Year Projects for CSE in JavaScript
Project Centers in Chennai
free fire apk for android and pc click here for more info
ReplyDeleteOkay prefer to get into an ethical hacking framework soon enough to turn into an analyst for Cyber Security proficient? The correct method to kick begin a phenomenal business with cyber Security is to attempt after an affirmation course in the certified ethical hacking course in Gurgaon with the fundamental framework unquestionably.
ReplyDeleteFor More Info:- Ethical Hacking course in Gurgaon