An open API service indexing awesome lists of open source software.

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.

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
```