@lofi-js/parser 0.1.0 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -13,12 +13,12 @@ npm i @lofi-js/parser
|
|
|
13
13
|
### Usage
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
-
import { parseLockfile } from
|
|
16
|
+
import { parseLockfile } from '@lofi-js/parser';
|
|
17
17
|
|
|
18
18
|
// From a path
|
|
19
|
-
const lockfile = await parseLockfile(
|
|
19
|
+
const lockfile = await parseLockfile('./package-lock.json');
|
|
20
20
|
|
|
21
|
-
const entry = lockfile.get(
|
|
21
|
+
const entry = lockfile.get('react', '19.0.0');
|
|
22
22
|
console.log(entry?.integrity, entry?.dependencies);
|
|
23
23
|
```
|
|
24
24
|
|
|
@@ -41,7 +41,7 @@ console.log(entry?.integrity, entry?.dependencies);
|
|
|
41
41
|
Results in a parsed lockfile. `input` is either the path to a lockfile or the content of one.
|
|
42
42
|
|
|
43
43
|
```ts
|
|
44
|
-
const lockfile = await parseLockfile(
|
|
44
|
+
const lockfile = await parseLockfile('./package-lock.json');
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
#### `parseLockfileSync(input: string): Lockfile`
|
|
@@ -106,10 +106,10 @@ The result of `parseLockfile`.
|
|
|
106
106
|
| `toJSON()` | `LockfileJSON` | Plain data in JSON format |
|
|
107
107
|
|
|
108
108
|
```ts
|
|
109
|
-
const lockfile = await parseLockfile(
|
|
109
|
+
const lockfile = await parseLockfile('./package-lock.json');
|
|
110
110
|
|
|
111
|
-
for (const chain of lockfile.why(
|
|
112
|
-
console.log(chain.map((entry) => entry.name).join(
|
|
111
|
+
for (const chain of lockfile.why('js-tokens', '4.0.0')) {
|
|
112
|
+
console.log(chain.map((entry) => entry.name).join(' > '));
|
|
113
113
|
}
|
|
114
114
|
// react > loose-envify > js-tokens
|
|
115
115
|
// react-dom > loose-envify > js-tokens
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lofi-js/parser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "A typescript lockfile parser. Parse lockfiles of any package manager (npm, pnpm, yarn, bun).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun.lock",
|
|
@@ -31,8 +31,7 @@
|
|
|
31
31
|
"./package.json": "./package.json"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
|
-
"access": "public"
|
|
35
|
-
"provenance": true
|
|
34
|
+
"access": "public"
|
|
36
35
|
},
|
|
37
36
|
"scripts": {
|
|
38
37
|
"build": "tsdown",
|