Giter Club home page Giter Club logo

create-ts-library's Introduction

create-ts-library

npm version

Create typescript-based javascript libraries without any configuration. Simply run create-ts-library init, and it will generate a project structure for you:

project
├─ src
│  └─ index.ts
├─ test
│  └─ index.test.ts
├─ tslint.json
└─ tsconfig.json

You will also need to set the name, version & config/library properties of your package.json-file.

{
  "name": "<name>",
  "version": "<version>",
  "config": {
    "library": "<module>"
  }
}

Use create-ts-library build to build your library for distribution.

This will output multiple different consumable versions of the library into the dist folder. The consumable versions are:

  • ./lib - The compiled library with commonjs modules.
  • ./es - The compiled library with native javascript modules.
  • ./types - The type declarations for the library.
  • <name>.<version>.js - A single bundled file, containing the whole library.
  • <name>.<version>.min.js - A minified version of the bundled library.
  • <name>.<version>.d.ts - A type declaration file for the bundled library.

Commands

Flag Description
init Set up required files.
build Run a full build.
dev Build a development bundle.
prod Build a production bundle.
lib Build a commonjs library.
es Build a esnext library.
test Run tests.
watch Run in watch mode.
help Display commands.
lint Lint Project.

More

If you want to override the default webpack configuration, you just need to create a new file named webpack.config.ts in the project root directory.

create-ts-library's People

Contributors

dependabot[bot] avatar glinkis avatar schneems avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

chengchencc

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.