Comparing version 0.0.1 to 0.1.0
{ | ||
"name": "depseek", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Seeks for dependency references in JS/TS code", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -41,3 +41,19 @@ # depseek | ||
``` | ||
### Options | ||
By default `depseek` extracts only `require` and `import` arguments. You can also capture bound comments. | ||
```ts | ||
const depsAndComments = await depseek(stream, {comments: true}) | ||
[ | ||
{ type: 'dep', value: 'node:fs', index: 17 }, | ||
{ type: 'dep', value: 'foo', index: 34 }, | ||
{ type: 'comment', value: ' @1.0.0', index: 46 } | ||
//... | ||
] | ||
``` | ||
Stream buffer size set to `1000` by default. You can change the limit by passing `bufferSize`. | ||
```ts | ||
const deps = await depseek(stream, {bufferSize: 10000}) | ||
``` | ||
## Refs | ||
@@ -44,0 +60,0 @@ * [browserify/module-deps](https://github.com/browserify/module-deps) |
@@ -8,3 +8,7 @@ /// <reference types="node" resolution-mode="require"/> | ||
}; | ||
export declare const depseek: (stream: Readable) => Promise<TCodeRef[]>; | ||
type TOpts = { | ||
comments?: boolean; | ||
bufferSize?: number; | ||
}; | ||
export declare const depseek: (stream: Readable, opts?: TOpts) => Promise<TCodeRef[]>; | ||
export {}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10374
163
65