Compiling and running your code
Now that you have some Derw code, it's time to turn it into something useful. This can be done through either compiling the code, or through bundling it - which also compiles your code.
Compiling
Compiling Derw can be done through the derw compile
command. It will compile everything in your src
folder and anything that they depend upon. You can specify if you want to generate TypeScript or JavaScript, but the recommended option is TypeScript.
You can then run the compiled code via ts-node src/<NameOfYourFile>.ts
or node src/<NameOfYourFile>.js
if you used js as an target. Note that if you used js as a target, your dependencies may need to be compiled if they relied on an npm package that did not provide JavaScript output.
Bundling
You would then want to reference the generated file inside a html file, for example:
Last updated