https://github.com/claviz/dts-extractor
Extract definition files from local node modules.
https://github.com/claviz/dts-extractor
dts extractor type-definitions
Last synced: about 1 year ago
JSON representation
Extract definition files from local node modules.
- Host: GitHub
- URL: https://github.com/claviz/dts-extractor
- Owner: Claviz
- License: mit
- Created: 2019-10-29T12:40:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-02T03:31:00.000Z (over 3 years ago)
- Last Synced: 2025-04-19T19:05:31.128Z (about 1 year ago)
- Topics: dts, extractor, type-definitions
- Language: TypeScript
- Size: 534 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dts-extractor [](https://travis-ci.org/Claviz/dts-extractor) [](https://codecov.io/gh/Claviz/dts-extractor) 
Extract definition files from local node modules.
## Installation & Usage
`npm install dts-extractor`
Usage:
```js
const dtsExtractor = require('dts-extractor');
(async () => {
const dts = await dtsExtractor.getDts({
nodeModulesPath: './node_modules', // path in file system where packages located
packages: ['xlstream', '@types/moment'], // list of packages
});
})();
```
### Usage with Monaco Editor
One of the use-cases for this package is to supply custom typings for Monaco Editor. When typings are extracted as shown in the code snippet above, they can be plugged in to Monaco Editor:
```js
for (const key of Object.keys(dts)) {
monaco.languages.typescript.typescriptDefaults.addExtraLib(dts[key], key);
}
```
In result, IntelliSense will be enabled for desired packages:
