# @ts-type/package-dts

> A Typescript type definition for NPM package json

Latest version **3.0.9** (published 2026-03-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install @ts-type/package-dts
pnpm add @ts-type/package-dts
yarn add @ts-type/package-dts
bun add @ts-type/package-dts
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.9 |
| Published | 2026-03-31 |
| First published | 2019-05-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 1.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | bluelovers |
| Keywords | .d.ts, @types, declaration, definition, dev, develop, development, dts, environment, ide, interface, json, node, package, package.json, playground, runtime, schema, ts, type, type-level, typeing, typelevel, types, typescript, typing, typings |

## Links

- npm: https://www.npmjs.com/package/@ts-type/package-dts
- Repository: https://github.com/bluelovers/ws-ts-type
- Homepage: https://github.com/bluelovers/ws-ts-type/tree/master/packages/package-dts#readme
- Issues: https://github.com/bluelovers/ws-ts-type/issues
- npm.io page: https://npm.io/package/@ts-type/package-dts

## Dependencies (2)

- [ts-type](https://npm.io/package/ts-type.md) ^3.0.13
- [@types/semver](https://npm.io/package/@types/semver.md) ^7.7.1

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 3.0.9 (latest) — 2026-03-31
- 3.0.8 — 2026-03-28
- 3.0.7 — 2026-03-15
- 3.0.6 — 2026-03-07
- 3.0.5 — 2026-03-07
- 3.0.3 — 2026-03-07
- 3.0.2 — 2026-03-07
- 3.0.1 — 2026-03-07
- 2.0.8 — 2022-10-10
- 2.0.7 — 2022-10-10
- 2.0.6 — 2022-10-10
- 2.0.5 — 2022-08-10
- 2.0.4 — 2022-08-10
- 2.0.3 — 2022-08-10
- 2.0.2 — 2022-07-06
- … 58 more at https://npm.io/package/@ts-type/package-dts/versions

## README

# package-dts

NPM 配置文件（package.json、.eslintrc.json、tsconfig.json、.travis.yml）的 TypeScript 類型定義

TypeScript type definitions for NPM configuration files (package.json, .eslintrc.json, tsconfig.json, .travis.yml)

## 功能特點 / Features

- 完整的 package.json 類型定義
- Complete package.json type definitions
- .eslintrc.json 類型定義
- .eslintrc.json type definitions
- tsconfig.json 類型定義
- tsconfig.json type definitions
- .travis.yml 類型定義
- .travis.yml type definitions
- 支援讀取並解析配置檔案
- Support reading and parsing configuration files

## 安裝 / Install

```bash
npm install @ts-type/package-dts
# or
yarn add @ts-type/package-dts
```

## 使用範例 / Usage Example

```typescript
import IPackageJson from '@ts-type/package-dts/package-json';
import { readPackageJson } from '@ts-type/package-dts';

// 讀取 package.json
const pkg = readPackageJson('./package.json');

// 使用類型
const name: string = pkg.name;
const version: string = pkg.version;
const keywords: string[] = pkg.keywords ?? [];

// 驗證類型
const devDeps = pkg.devDependencies;
if (devDeps) {
    Object.keys(devDeps).forEach(dep => {
        console.log(`${dep}@${devDeps[dep]}`);
    });
}
```

![image](https://github.com/bluelovers/ws-ts-type/raw/master/packages/package-dts/readme/image.png)

---
_Source: https://npm.io/package/@ts-type/package-dts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
