This is a simple template repository I use for creating npm packages with typescript.
- Write in Commonjs, Build in Commonjs which in turn can be imported in ESM too. (see test.mjs)
- Eslint & Prettier
- Git hooks using Husky
- Use lint-staged to lint and run prettier on staged files before commit
- Github workflows for building, testing, linting and running prettier.
Generate from the template.
Clone it with git and install. Then run setup.
$ git clone https://github.com/<username>/<repo-name>.git
# use npm if u don't have pnpm
$ pnpm install
# again, use npm if u don't have pnpm. This builds the files and sets up husky
$ pnpm run setup
Edit package.json as per your project. Make your package. Remove everything in Readme from here to top.
Super awesome package description
$ npm install pkg-name
# or
$ yarn add pkg-name
# or
$ pnpm add pkg-name
// Commonjs require
const pkg = require('pkg-name');
// ES module import
import pkg from 'pkg-name';
Package Name © Author-name. Authored and maintained by Author-name.
Released under MIT License