0.1.2 • Published 4 years ago

@jensmeindertsma/package-template v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

package-template

A template for quick-starting your NPM package.

This project includes fully automated formatting, linting, testing, type-checking and publishing. It gives you everything you need to publish your own package to the NPM registry with confidence. By default this project will publish a new version to the NPM registry when you push a commit to the main branch that has a tag with the same name. See the package.json file for included scripts.

To help move the ecosystem forward, this package only supports ECMAScript Modules. It does not provide CommonJS modules. You can import this package from CommonJS, but only asynchronously. The user of your package must have TypeScript@<4.5-beta or higher> installed and must have set "module": "nodenext" in his tsconfig.json file.

To use this yourself, add a NPM_TOKEN secret to your GitHub repository containing an API token you can retrieve from the NPM website under "Account Settings". This is needed for the automated publishing.

API

This package includes a basic add function that just demonstrates the functionality of the package.

add

The function add adds two numbers together and returns the result:

import { add } from "@jensmeindertsma/template-package";

const result = add(2, 3);

expect(result).toEqual(5);