esgo
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Monoid TypeScript NPM Boilerplate

A TypeScript NPM boilerplate that suits how we usually write TypeScript.

Features

  1. Outputs modern style typescript package in dist/{cjs,esm,types}/ using tsc and esbuild.

  2. Respects modern package.json

    1. type set to "module"
    2. main pointed to ./dist/cjs/index.cjs for legacy NodeJS in commonjs format.
    3. module pointed to ./dist/esm/index.mjs for bundlers in esmodule format.
    4. types for typescript declarations.
    5. exports following Conditional Exports for newer NodeJS to find esmodule format when using import and commonjs format when using require.
  3. Test or demonstrate your package under demo/{node,browser}/.

  4. Only files under dist/ will be published to npm.

  5. dist/ will NOT be gitignored by default.

  6. .eslintrc.js based on airbnb.

  7. esmo installed to load typescript for node.

Commands

  yarn build

Build the output directory.

  yarn lint

Lint the project.

  yarn cli

Execute the cli with node.

  yarn ts <file-name>

Execute arbitrary typescript file with esmo.

Customization

  1. Find ts-npm-boilerplate, replace that with your package name.

  2. Find your-cli-name, replace that with your cli name.

Usage

  1. Degit this repository
npx degit https://github.com/MonoidDev/ts-npm-boilerplate
  1. Use this template

Click the green button Use this template on the top-right side of this GitHub repository (https://github.com/MonoidDev/ts-npm-boilerplate).

Readme

Keywords

Package Sidebar

Install

npm i esgo

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

10.4 kB

Total Files

19

Last publish

Collaborators

  • chenyuwang