UNPKG

2.92 kBMarkdownView Raw
1# @jsdocs-io/extractor
2
3[![Build status](https://img.shields.io/github/workflow/status/jsdocs-io/extractor/CI/main)](https://github.com/jsdocs-io/extractor/actions?query=workflow%3ACI)
4[![Coverage](https://img.shields.io/codecov/c/gh/jsdocs-io/extractor)](https://codecov.io/gh/jsdocs-io/extractor)
5[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@jsdocs-io/extractor)
6![Language](https://img.shields.io/github/languages/top/jsdocs-io/extractor)
7[![Dependencies](https://img.shields.io/david/jsdocs-io/extractor)](https://david-dm.org/jsdocs-io/extractor)
8[![npm](https://img.shields.io/npm/v/@jsdocs-io/extractor)](https://www.npmjs.com/package/@jsdocs-io/extractor)
9[![License](https://img.shields.io/github/license/jsdocs-io/extractor)](https://github.com/jsdocs-io/extractor/blob/main/LICENSE)
10
11This package downloads npm packages and extracts their public API.
12
13## API & Package Info
14
15- Explore the API on [**jsDocs.io**](https://www.jsdocs.io/package/@jsdocs-io/extractor)
16- View package contents on [**unpkg**](https://unpkg.com/@jsdocs-io/extractor/)
17- View repository on [**GitHub**](https://github.com/jsdocs-io/extractor)
18- Read the changelog on [**GitHub**](https://github.com/jsdocs-io/extractor/blob/main/CHANGELOG.md)
19
20## Install
21
22Using `npm`:
23
24```
25npm i @jsdocs-io/extractor
26```
27
28Using `yarn`:
29
30```
31yarn add @jsdocs-io/extractor
32```
33
34## Usage Example
35
36Analyze the latest version of the `query-registry` package from the npm registry:
37
38> **Warning**: analyzing packages is a blocking operation that requires some time (even seconds) to finish! Using a worker pool is recommended.
39
40```typescript
41import { analyzeRegistryPackage } from '@jsdocs-io/extractor';
42
43(async () => {
44 const info = await analyzeRegistryPackage({ name: 'query-registry' });
45
46 // Output: 'query-registry'
47 console.log(info.manifest.name);
48
49 // Output: 'string'
50 console.log(typeof info.api?.overview);
51})();
52```
53
54## Debug
55
56Debug messages are available when the `DEBUG` environment variable is set to `@jsdocs-io/extractor`:
57
58```bash
59DEBUG="@jsdocs-io/extractor"
60```
61
62For more information, see the [debug package](https://www.npmjs.com/package/debug).
63
64## License
65
66 AGPL-3.0-or-later
67
68Copyright (C) 2021 Edoardo Scibona
69
70This program is free software: you can redistribute it and/or modify
71it under the terms of the GNU Affero General Public License as published by
72the Free Software Foundation, either version 3 of the License, or
73(at your option) any later version.
74
75This program is distributed in the hope that it will be useful,
76but WITHOUT ANY WARRANTY; without even the implied warranty of
77MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
78GNU Affero General Public License for more details.
79
80You should have received a copy of the GNU Affero General Public License
81along with this program. If not, see <https://www.gnu.org/licenses/>.