Open plaurent opened 4 years ago
You need evaluate runtime.js
located in the lib
folder prior to any NilScript compiled output.
cat lib/runtime.js ~/Project1/a.js | node -
Note: the 3.0 branch is still under development with breaking changes to syntax.
Wow, thank you it worked! Is this the way of running things for the foreseeable future? Would you advise I file a pull request to include this in the readme? (after the Compiling section)
Usually, you wouldn't use cat
, as this will invalidate source map data. I'm not sure what the modern way of doing this is. We used source-map-concat
in the past, but that hasn't been updated for 4 years.
The Compiling section should probably mention that runtime.js needs to either be loaded first or concatenated in. I need to ponder the exact phrasing (also the readme is being overhauled since the whole language is rapidly changing in 3.0 ;) )
The README in the 3.0 branch specifies how to compile code, but not how to run the result.
Given a file called Example1.ns:
using
nsc Example1.ns -o a.js
, when I run a.js I get:How can I run a.js? Do I need to import something?