Following Publishing Node modules with TypeScript and ES modules.
https://blog.logrocket.com/publishing-node-modules-typescript-es-modules/
James Skemp 2436430806 | ||
---|---|---|
src | ||
.editorconfig | ||
.eslintrc.cjs | ||
.gitignore | ||
README.md | ||
package-lock.json | ||
package.json | ||
tsconfig-cjs.json | ||
tsconfig.json |
README.md
NPM package with TypeScript
Following Publishing Node modules with TypeScript and ES modules.
Commands
npm init -y
git init
npm install --save-dev typescript
npx tsc --init
# Add code and configuration.
npx tsc -p tsconfig.json
# Move the above into package.json.
npm run tsc
# Run ESLint
npm run lint
# When ready.
npm publish