kyleect / ts-npm-module

A template for writing npm modules in typescript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ts-npm-module

A template for writing npm modules in typescript.


Technologies

Getting started

Clone

$ git clone https://github.com/kyleect/ts-npm-module.git module-name
$ cd module-name

Bootstrap

This will install npm depedencies, typings and builds the module.

$ npm run bootstrap

Configure

  • Edit "name": "ts-npm-module" in ./package.json to the name of your module
  • Edit "description": "" in ./package.json to the description of your module
  • Edit "repository": {} in ./package.json to the repository of your module
  • Edit "private": true to false in ./package.json to enable publishing your module to npm
  • Edit tslint.json for your module
  • Edit .eslintrc.js for your module
  • Edit README.md for your module

Clean slate (optional)

Delete the repository's history, initializes as a new git repository and commits all files in to an initial commit.

$ rm -rf .git
$ git init
$ git commit -m "Initial commit"

or you can run:

$ npm run cleanslate

Developing

The entry point for the module is ./src/index.ts.

// ./src/index.ts
export default function module() {
  //...
};

Testing

Tests are located at ./tests with a test pattern of ./tests/**/*-test.ts.

$ npm test

Linting

$ npm run lint

Building

Builds are located at ./lib.

$ npm run build

License

MIT

About

A template for writing npm modules in typescript.

License:MIT License


Languages

Language:JavaScript 60.2%Language:Shell 31.4%Language:TypeScript 8.5%