Skip to content

millionco/npm-package-template

Repository files navigation

Example

version downloads

A template for npm packages with TypeScript, pnpm monorepo, vite-plus, and changesets.

Install

npm install example

Usage

import { greet, add } from "example";

greet("world"); // "Hello, world!"
add(1, 2); // 3

Browser (IIFE)

<script src="https://unpkg.com/example/dist/index.iife.js"></script>
<script>
  Example.greet("world"); // "Hello, world!"
</script>

Development

This is a pnpm monorepo using vite-plus for building and changesets for versioning.

Setup

pnpm install

Build

pnpm build

Test

pnpm test

Lint & Format

pnpm lint
pnpm format

Release

pnpm changeset       # create a changeset
pnpm version         # bump versions
pnpm release         # build + publish

Contributing

Pull requests are welcome! Please run pnpm check before submitting.

License

MIT

About

NPM package template

Resources

License

Contributing

Stars

Watchers

Forks

Contributors