Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 1.63 KB

README.md

File metadata and controls

27 lines (22 loc) · 1.63 KB

template ts

tests types dependencies semantic versioning license

A template for typescript dependency modules that run in node. See template-ts-browser for the same thing but targeting a browser environment.

use

  1. Use the template button in github. Or clone this then rm -rf .git && git init.
  2. npm i && npm init.
  3. Edit README.md -- change the CI badge URL + rewrite docs
  4. Edit the source code in src/index.ts, edit tests in test

featuring

  • 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 in package.json to make sure the right format is used by consumers.
  • preversion npm hook -- lint via standardx.
  • 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