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 |
|
11 | This 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 |
|
22 | Using `npm`:
|
23 |
|
24 | ```
|
25 | npm i @jsdocs-io/extractor
|
26 | ```
|
27 |
|
28 | Using `yarn`:
|
29 |
|
30 | ```
|
31 | yarn add @jsdocs-io/extractor
|
32 | ```
|
33 |
|
34 | ## Usage Example
|
35 |
|
36 | Analyze 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
|
41 | import { 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 |
|
56 | Debug messages are available when the `DEBUG` environment variable is set to `@jsdocs-io/extractor`:
|
57 |
|
58 | ```bash
|
59 | DEBUG="@jsdocs-io/extractor"
|
60 | ```
|
61 |
|
62 | For more information, see the [debug package](https://www.npmjs.com/package/debug).
|
63 |
|
64 | ## License
|
65 |
|
66 | AGPL-3.0-or-later
|
67 |
|
68 | Copyright (C) 2021 Edoardo Scibona
|
69 |
|
70 | This program is free software: you can redistribute it and/or modify
|
71 | it under the terms of the GNU Affero General Public License as published by
|
72 | the Free Software Foundation, either version 3 of the License, or
|
73 | (at your option) any later version.
|
74 |
|
75 | This program is distributed in the hope that it will be useful,
|
76 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
77 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
78 | GNU Affero General Public License for more details.
|
79 |
|
80 | You should have received a copy of the GNU Affero General Public License
|
81 | along with this program. If not, see <https://www.gnu.org/licenses/>.
|