A template for typescript dependency modules that run in node. See template-ts-browser for the same thing but targeting a browser environment.
- Use the template button in github. Or clone this then
rm -rf .git && git init. npm i && npm init.- Edit
README.md-- change the CI badge URL + rewrite docs - Edit the source code in
src/index.ts, edit tests intest
- compile the source to both ESM and CJS format, and put compiled files in
dist. - ignore
distand*.jsin git, but don't ignore them in npm. That way we don't commit any compiled code to git, but it is available to consumers. - use npm's
prepublishOnlyhook to compile the code before publishing to npm. - use
exportsfield inpackage.jsonto make sure the right format is used by consumers. preversionnpm hook -- lint viastandardx.postversionnpm hook --git push && git push --tags && npm publish- eslint via standardx --
npm run lint - compile tests and run in a node environment
- CI via github actions