Skip to content
Stater kit for modern TypeScript library. Generate JS ready to be published on npm.
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
typings
.editorconfig
.gitignore
.prettierrc
LICENSE
README.md
azure-pipelines.yml
package.json
tsconfig.json
tslint.json

README.md

TypeScript Lib Starter TypeScript Lib Starter

TypeScript 3.5 styled with prettier styled with prettier styled with prettier styled with prettier

Stater kit for modern TypeScript libraries. Generates JavaScript ready to be published on npm.

Batteries included. Period.

Clone the repo

$ git clone git@github.com:fox1t/typescript-lib-starter.git {your_project_name}

$ cd {your_project_name}

Remove reference to this starter and re-init package.json

$ rm -rf .git && git init && npm init

Install development dependencies

$ npm i

Scripts

  • npm run build: build TypeScript sources to lib directory
  • npm publish: builds and publishes lib to npmjs.com
  • npm test: run tests in ./test directory using tap
  • npm run test:watch: watches ./src/ and ./test/ folders and restarts compilation and tests
  • npm run test:report: saves test report to out.tap file
  • npm run test:reporter: converts out.tap file to junit

External typings augmentation

This starter is already configured to allow you to extend typings of external packages. The logic behind it is based on this official template. To augment a module, just create a folder with the same name as the module you are augmenting and add an index.d.ts in it. Here you can find a real world example.

Automatic Test and Code Coverage

Includes azure-pipelines.yml configuration file. You can build, test and publish code coverage on Azure DevOps for free with GitHub integration for OSS projects.

Dev Dependencies

  • cross-env: sets TS_NODE_PROJECT for running tests with tap/ts-node crossplatform
  • husky: runs precommit lint hook
  • rimraf: removes lib folder crossplatform
  • chokidar-cli: file watcher
  • tap: test runner
  • tap-mocha-reporter: mocha reporter for tap
  • ts-node: runs tests without compiling
  • prettier
  • tslint
  • tslint-config-prettier: makes tslint work nice with prettier
  • typescript

Spread the word

If you use this starter, add this badge to your project to help standardising TS library develpment.

[![built with typescript-lib-starter](https://img.shields.io/badge/built%20with-typescript--lib--starter%20-blue.svg)](https://github.com/fox1t/typescript-lib-starter)

built with typescript-lib-starter

Example libs built with TypeScript Lib Starter

License

MIT

You can’t perform that action at this time.