@risiscafford/hello-npm
v1.0.5
Published
Forked from typescript-npm-library-starter to publish a test npm package
Downloads
4
Maintainers
Readme
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 environment and just want to start building as soon as possible.
This repo is a template for your library and ready to publish on NPM.

Just click on the green button to create your repo based on this one. It's just that easy 👍
Clone it to your computer, run npm install and start building!
Requirements
- TypeScript >= v3.7.4
- NodeJS >= v13.3
- NPM >= v6.13.6
Workflow
- Build your functionality
- Run a build with
npm run build - Commit changes
- Create a git tag
- Run
npm run versionto push all commits and tags - Run
npm publishto run all linting, formatting, build and publish it on NPM
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!
Run npm run test for 1 time only run. If you want to use the Jest watch option, run npm run test:watch.
Example readme content
Installation
npm install typescript-npm-library-starterHow to
import { Car } from 'typescript-npm-library-starter';
const car = new Car();
// add more of the example here