mkdir <project>
cd <project>
npm init
npm install -E -D typescript ts-node-dev @types/node
npm install -E -D eslint eslint-plugin-node
npm install -E -D jest ts-jest @types/jest
npm install -E -D rimraf
npx tsc --init
Described in StackOverflow TypeScript tsconfig settings for Node.js 12?
Besides the settings in tsconfig
it is also necessary to add type: module
in package.json
to use ES2020 module loading.
Described in StackOverflow What TypeScript configuration produces output closest to Node.js 14 capabilities?
The 30-second guide to publishing a TypeScript package to NPM