Skip to content

A template project for TypeScript libraries. Automatically builds to CJS, ESM, IIFE, for browser and Node.js. Supports API and CLI use likewise. Comes with modern and permissive tsconfig, eslint, jest and prettier configurations.

License

Notifications You must be signed in to change notification settings

jsheaven/template-for-libraries

Repository files navigation

@jsheaven/template-name

Explains what it does

User Stories

  1. As a developer, I want to use TemplateName for X

  2. As a developer, I don't want to do Y

Features

  • ✅ Does X and Y
  • ✅ Available as a simple API and simple to use CLI
  • ✅ Just 136 byte nano sized (ESM, gizpped)
  • ✅ Tree-shakable and side-effect free
  • ✅ Runs on Windows, Mac, Linux, CI tested
  • ✅ First class TypeScript support
  • ✅ 100% Unit Test coverage

Example usage (CLI)

npx @jsheaven/template-name templateName --foo X

You need at least version 18 of Node.js installed.

Example usage (API, as a library)

Setup

  • yarn: yarn add @jsheaven/template-name
  • npm: npm install @jsheaven/template-name

ESM

import { templateName } from '@jsheaven/template-name'

const result = await templateName({
  foo: 'X',
})

CommonJS

const { templateName } = require('@jsheaven/template-name')

// same API like ESM variant

About

A template project for TypeScript libraries. Automatically builds to CJS, ESM, IIFE, for browser and Node.js. Supports API and CLI use likewise. Comes with modern and permissive tsconfig, eslint, jest and prettier configurations.

Topics

Resources

License

Stars

Watchers

Forks