← 全部工具

npm-dts

热度 65 更新于 开发与构建

Simple DTS single-file generation utility for TypeScript bundles

npmauto-collected

安装

npm
npm install -g npm-dts

通过 npm 安装。

npm-dts

by Vytenis Urbonavičius

This utility generates single index.d.ts file for whole NPM package.

It allows creating bundled NPM library packages without TypeScript sources and yet still keeping code suggestions wherever these libraries are imported.

TypeScript picks up index.d.ts automatically.

---

Some useful forks:

  • @htho/npm-dts by Hauke Thorenz - custom alias functionality (--customAlias), tree shaking (--shake)

---

Installation

Local:

npm install --save-dev npm-dts

Global:

npm install -g npm-dts

---

CLI Usage

Please make sure that target project has "typescript" installed in nodemodules.

To see full CLI help - run without arguments: