A template for dependency JS modules -- modules intended to be a dependency of application code.
- Use the template button in github. Or clone this then
rm -rf .git && git init. Thennpm i && npm init. - Update the README file. Be sure to change the URL for the CI badge.
- Edit the source code in
src/index.js.
- compile the source to both ESM and CJS format, and put compiled files in
dist. - ignore
distin git, but don't ignore it 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 -- use@nichoth/check-max-depsto validate the number of dependencies, and lint viastandardx.- eslint via standardx --
npm run lint