Skip to content
A template for developing npm package that supports multiple module format(CommonJS, ESM, UMD)
JavaScript TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.editorconfig
.eslintrc.js
.gitignore
README.md
package-lock.json
package.json
tsconfig.base.json
tsconfig.cjs.json
tsconfig.esm.json
tsconfig.umd.json
webpack.config.js

README.md

TypeScript npm Package Template

A template for developing a npm package that supports multiple module formats (CommonJS, ES Modules and UMD).

File Structure

src/ # Source files written in TypeScript
  - moduleA.ts
  - moduleB.ts
  - index.ts
lib/ # CommonJS format (`module.exports/require`) JS files
  - moduleA.js
  - moduleB.js
  - index.js
esm/ # ES Modules format (`import/export`) JS files
  - moduleA.js
  - moduleB.js
  - index.js
umd/ # UMD format, bundled JS file
  - my-typescript-package.js

How to Develop

$ npm install
$ npm run build # generates `lib`, `esm`, and `umd`
You can’t perform that action at this time.