Last change
on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
408 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | # yarn-lockfile
|
---|
| 2 |
|
---|
| 3 | Parse and/or write `yarn.lock` files
|
---|
| 4 |
|
---|
| 5 | ## Usage Examples
|
---|
| 6 |
|
---|
| 7 | ```js
|
---|
| 8 | const fs = require('fs');
|
---|
| 9 | const lockfile = require('@yarnpkg/lockfile');
|
---|
| 10 | // or (es6)
|
---|
| 11 | import fs from 'fs';
|
---|
| 12 | import * as lockfile from '@yarnpkg/lockfile';
|
---|
| 13 |
|
---|
| 14 | let file = fs.readFileSync('yarn.lock', 'utf8');
|
---|
| 15 | let json = lockfile.parse(file);
|
---|
| 16 |
|
---|
| 17 | console.log(json);
|
---|
| 18 |
|
---|
| 19 | let fileAgain = lockfile.stringify(json);
|
---|
| 20 |
|
---|
| 21 | console.log(fileAgain);
|
---|
| 22 | ```
|
---|
Note:
See
TracBrowser
for help on using the repository browser.