Files
yarn/packages/lockfile
jonathan schatz dd94174ad0 Update: Update the lockfile parser README.md (#4232)
* Update README.md

add es6 example to lockfile docs

* Update README.md
2017-08-23 10:59:10 +01:00
..

yarn-lockfile

Parse and/or write yarn.lock files

Usage Examples

const fs = require('fs');
const lockfile = require('@yarnpkg/lockfile');
// or (es6)
import fs from 'fs';
import * as lockfile from '@yarnpkg/lockfile';

let file = fs.readFileSync('yarn.lock', 'utf8');
let json = lockfile.parse(file);

console.log(json);

let fileAgain = lockfile.stringify(json);

console.log(fileAgain);