Skip to content
/ ts-library-template Public template

A template for creating Javascript libraries using rollup, vitest, eslint and lint-staged

License

Notifications You must be signed in to change notification settings

canbax/ts-library-template

Repository files navigation

Your Library Name

Your library description and a gif or image might be good below

Usage

Use npm

Run command npm i your-library

import ESM module

import { yourLibFunction } from 'your-library';

import CommonJS module

const lib = require("your-library");
console.log(lib.yourLibFunction(1, 2);

import UMD module

Add <script src="https://unpkg.com/your-library/dist/your-library.umd.js"></script> to your HTML file.

Then you can call API functions like lib.yourLibFunction(1, 2)

Development

  • npm run build to generate production build distribution files.
  • npm run dev to generate build files as you develop
  • npm run test to run unit tests

API

function yourLibFunction(a: number, b: number): number

  • returns sum of 2 numbers

About

A template for creating Javascript libraries using rollup, vitest, eslint and lint-staged

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published