Giter VIP home page Giter VIP logo

typescript-module-template's Introduction

TypeScript Module Template

This is a template for creating a npm module written in TypeScript.

Usage

Just click the "Use this template" button and create a new repository.

Initialization

  1. Change these lines in package.json:
    {
    "keywords": ["your", "keywords", "<"],
    "description": "Your module description here <",
    "license": "Your license here <",
  2. Change the README.md file to your needs.
  3. Add LICENSE file if you want to.

engines field in package.json

node

You can specify a node version in this field. We'll use this version to set up the CI environment.

npm / yarn / pnpm

You can specify a package manager in this field. We'll use this package manager to install dependencies.

The compatibility of esm & cjs

There's no need to do some additional work to make the module compatible with esm and cjs environments. Your module will work in both environments without any additional configuration.

Project Structure

Just like a normal TypeScript project, but with a src folder. We use mocha for testing, all test files should be ended with .spec.ts.

src/
  index.ts
  your-module.ts
  your-module.spec.ts

Publishing to npm

Generate a new npm token and add it to the repository secrets as NPM_TOKEN. Then, create a new release and the CI will automatically publish the package to npm.

typescript-module-template's People

Contributors

joyqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.