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}/usingtscandesbuild.Respects modern package.json
typeset to"module"mainpointed to./dist/cjs/index.cjsfor legacy NodeJS in commonjs format.modulepointed to./dist/esm/index.mjsfor bundlers in esmodule format.typesfor typescript declarations.exportsfollowing Conditional Exports for newer NodeJS to find esmodule format when usingimportand 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.jsbased on airbnb.esmo installed to load typescript for node.
Commands
yarn buildBuild the output directory.
yarn lintLint the project.
yarn cliExecute 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).
4 years ago