This is a template for creating a npm module written in TypeScript.
Just click the "Use this template" button and create a new repository.
- Change these lines in
package.json
:{ "keywords": ["your", "keywords", "<"], "description": "Your module description here <", "license": "Your license here <",
- Change the
README.md
file to your needs. - Add LICENSE file if you want to.
You can specify a node version in this field. We'll use this version to set up the CI environment.
You can specify a package manager in this field. We'll use this package manager to install dependencies.
There's no need to do some additional work to make the module compatible with esm
and cjs
environments.
Your module will work in both environments without any additional configuration.
Just like a normal TypeScript project, but with a src
folder.
We use mocha for testing, all test files should be ended with .spec.ts
.
src/
index.ts
your-module.ts
your-module.spec.ts
Generate a new npm token and add it to the repository secrets as NPM_TOKEN
. Then, create a new release and the CI will automatically publish the package to npm.