1.0.4 • Published 4 years ago

typescript-npm-library-starter v1.0.4

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

Typescript NPM Library Starter

Starter for a NPM package build with TypeScript goodness 🚀

Check the example NPM package based on this repo.

How to use

If you want to create a small or big JavaScript/TypeScript library to push it to NPM (or other platform). You don't want to worry about setting up a development envoirment and just want to start building as soon as possible.

This repo is a template for your library and ready to publish on NPM.

npm.io

Just click on the green button to create your repo based on this one. It's just that easy 👍

Requirements

  • TypeScript >= v3.7.4
  • NodeJS >= v13.3
  • NPM >= v6.13.6

Dependencies

Generate recommended documentation/files to improve contribution

The following files are generated by the CGX CLI.

Run npm run cgx to start the CLI.

  • CODE_OF_CONDUCT.md
  • CONTRIBUTION.md
  • .github/
    • ISSUE_TEMPLATE
    • PULL_REQUEST_TEMPLATE

CGX offers options for Github, Gitlab, Bitbucket and will expand in future versions.

TypeScript Type Coverage

For checking the type coverage in TypeScript, we used the TSCOV CLI by the Liftr framework.

Run npm run tscov to check your types.

Code formatting

To make sure that everyone, who works on your library formats it's code equally, we included TSlint with a plugin for Prettier.

In the .prettierrc you can change the settings to your preferences.

Testing

For running tests against your code we included Jest. Jest is a JavaScript/TypeScript testing framework with a focus on simplicity, that's why we like it so much!

Example readme content

Installation

npm install typescript-npm-library-starter

How to

import { Car } from 'typescript-npm-library-starter';

const car = new Car();

// add more of the example here