Skip to content

ts tips

Amadeusz Wieczorek edited this page May 16, 2018 · 1 revision

npx tsc --init creates the tsconfig.json

  • What is npx?
  • npx is an utility that either executes the command and if necessary, installs it prior to execution.

npm install @types/node --save-dev allowed me to use node modules, e.g. fs

How do I use other modules, e.g. XMLDocument and XMLSerializer (default Web APIs)?

  • They are built into the browser runtime, and they don't work outside of the browser (e.g. in node.js)
  • Consider using something like parse5 and xmlserializer
  • this was not at all nice to use. Sadly the project in question lost its TS privileges and will be written in language that can handle SVG
Clone this wiki locally