A template for typescript dependency modules that run in node. See template-ts-browser for the same thing but targeting a browser environment.
Important
This builds to ESM only.
- 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
dist
and*.js
in 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
prepublishOnly
hook to compile the code before publishing to npm. - use
exports
field inpackage.json
to make sure the right format is used by consumers. preversion
npm hook -- lint viastandardx
.postversion
npm 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