Skip to content

colinhacks/npm-ts-starter

Repository files navigation

npm-ts-starter

Usage

  1. Clone this repo:

      git clone git@github.com: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: 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.


Sample NPM Package

License npm stars coverage


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
pkgname@1.0 Initial release

About

A project template for TypeScript npm packages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published