https://github.com/jsheaven/template-for-libraries
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.
https://github.com/jsheaven/template-for-libraries
library template
Last synced: 5 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/jsheaven/template-for-libraries
- Owner: jsheaven
- License: mit
- Created: 2023-02-07T00:59:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-17T22:47:37.000Z (about 2 years ago)
- Last Synced: 2025-08-09T08:40:16.625Z (11 months ago)
- Topics: library, template
- Language: JavaScript
- Homepage:
- Size: 68.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
@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](https://www.nodejs.org) installed.
Example usage (API, as a library)
Setup
- yarn: `yarn add @jsheaven/template-name`
- npm: `npm install @jsheaven/template-name`
ESM
```ts
import { templateName } from '@jsheaven/template-name'
const result = await templateName({
foo: 'X',
})
```
CommonJS
```ts
const { templateName } = require('@jsheaven/template-name')
// same API like ESM variant
```