https://github.com/nichoth/template-js
A template for JS projects
https://github.com/nichoth/template-js
Last synced: 5 months ago
JSON representation
A template for JS projects
- Host: GitHub
- URL: https://github.com/nichoth/template-js
- Owner: nichoth
- Created: 2022-12-25T21:36:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-12T21:51:02.000Z (over 1 year ago)
- Last Synced: 2025-10-05T01:43:07.145Z (10 months ago)
- Language: JavaScript
- Size: 315 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# template js 
A template for *dependency* JS modules -- modules intended to be a dependency of application code.
## use
1. Use the *template* button in github. Or clone this then `rm -rf .git && git init`. Then `npm i && npm init`.
2. Update the README file. Be sure to change the URL for the CI badge.
3. Edit the source code in `src/index.js`.
## featuring
* compile the source to both ESM and CJS format, and put compiled files in `dist`.
* ignore `dist` in 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 `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 -- use `@nichoth/check-max-deps` to validate the number of dependencies, and lint via `standardx`.
* eslint via [standardx](https://www.npmjs.com/package/standardx) -- `npm run lint`