Opinionated starter for server-side Node.js libraries, with TypeScript, tests with Jest, automated releases with GitHub Actions and Semantic Release, and coverage reporting from Travis CI to Coveralls.
To get started, first generate your new repository. There are two ways to do this:
- Generate a repository with Node.ts template is GitHub's preferred way
- Import this repository keeps the commit history, which you may want
Make the following changes to this README.md
(note that these changes are case-sensitive):
- Replace "Node.ts" with your project name
- Replace "AnandChowdhary/node.ts" with your GitHub "username/repository"
- Replace "@anandchowdhary/node.ts" with your npm package name
- Replace "@anandchowdhary%2Fnode.ts" with your npm package name, URL-encoded
Make the following changes to package.json
:
- Replace "@anandchowdhary/node.ts" with your npm package name
- Change the version to "0.0.0" for Semantic Release to take over
- Replace the description with your npm package description
- Replace "AnandChowdhary/node.ts" with your GitHub "username/repository"
- Replace "Anand Chowdhary mail@anandchowdhary.com" with you as the author
- Replace "anandchowdhary.github.io" with "username.github.io"
- Add your npm token (
NPM_TOKEN
) as a GitHub secret in your repository (more details) - Log in or sign up on Coveralls and add your repository
- Remove this section ("Using Node.ts"), keeping the "Usage" section below
- Replace "AnandChowdhary/eject-dependencies" with your GitHub "username/repository" in
.releaserc.json
- Set up GitHub Pages with
master
branch - Write commits messages using Gitmoji
Install the package from npm:
npm install @anandchowdhary/node.ts
Import and use;
import { nodeTs } from "@anandchowdhary/node-ts";
nodeTs();
Build TypeScript:
npm run build
Run unit tests and view coverage:
npm run test-without-reporting