npm.io
1.1.0 • Published 7 years ago

@yarnpkg/lockfile

Licence
BSD-2-Clause
Version
1.1.0
Deps
0
Size
273 kB
Vulns
0
Weekly
0
Stars
41.5K

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);

Keywords