esgo v0.0.1
Monoid TypeScript NPM Boilerplate
A TypeScript NPM boilerplate that suits how we usually write TypeScript.
Features
Outputs modern style typescript package in
dist/{cjs,esm,types}/
usingtsc
andesbuild
.Respects modern package.json
type
set to"module"
main
pointed to./dist/cjs/index.cjs
for legacy NodeJS in commonjs format.module
pointed to./dist/esm/index.mjs
for bundlers in esmodule format.types
for typescript declarations.exports
following Conditional Exports for newer NodeJS to find esmodule format when usingimport
and commonjs format when usingrequire
.
Test or demonstrate your package under
demo/{node,browser}/
.Only files under
dist/
will be published to npm.dist/
will NOT be gitignored by default..eslintrc.js
based on airbnb.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
Find
ts-npm-boilerplate
, replace that with your package name.Find
your-cli-name
, replace that with your cli name.
Usage
- Degit this repository
npx degit https://github.com/MonoidDev/ts-npm-boilerplate
- 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).
3 years ago