npm-ts-starter

A project template for TypeScript npm packages

MIT License

Stars
8

Usage

  1. Clone this repo:

      git clone [email protected]:vriad/npm-ts-starter.git yourpkgname
      cd yourpkgname
    

    Then create a new repoisitory in your GitHub account and set it up

    rm -rf .git
    git init
    git remote add origin GITHUB_REMOTE_URL
    git add .
    git commit -am "Initial commit"
    git push origin master
    
  2. In package.json: update "name", "description", "repository", "keywords", "tags", "hompage", and any other relevant fields.

  3. Implement your module! Start writing code in index.ts.

  4. Write tests! See 'tests/sample.ts' for some basic examples. We use Jest as a test runner; check out the documenation at https://jestjs.io. Run your tests with yarn test. This automatically generates a badge like this to display your test coverage:

  5. Write a README. An initial template is below. Find and replace all references to "pkgname" with your package's name and "username" with your GitHub username. Delete this "Meta-README" section before you deploy (everything above the red line).

  6. Install Node (here) if you haven't already. This automatically installs the npm command-line tool to your computer.

  7. Create an npm account through npmjs.com.

  8. Use the npm login command to sign into npm on your computer.

  9. Build your project with yarn build. This transpiles your TyeScript to JavaScript code and writes the output into /lib.

  10. Publish to npm with npm publish.

Table of contents

Installation

To install the latest version:

npm install --save pkgname
yarn add pkgname

TypeScript versions

Compatible with TypeScript 3.2+.

Usage

Write stuff here!

Changelog

version release notes
[email protected] Initial release
Badges
Extracted from project README
coverage License npm stars coverage