yarn-lock-convert
v1.0.2
Published
Converts the yarn.lock file into JSON
Downloads
9
Readme
yarn-lock-convert
This program uses yarn's official parser to read the yarn.lock
file and then
produce a promise that returns a json/object.
Install
YARN
yarn add yarn-lock-convert
or
NPM
npm install yarn-lock-convert
Usage
Typescript:
import * as yarnconverter from 'yarn-lock-convert';
//if you want an object
yarnconverter.toObject().then((yarnObject)=>console.log(yarnObject));
//if you want a JSON file
yarnconverter.toJson().then((yarnJsonString)=>console.log(yarnJsonString));
//if you want another directory
yarnconverter.toJson("/home/www/someproject").then((yarnJsonString)=>console.log(yarnJsonString));
Javascript:
const yarnconverter = require("yarn-lock-convert");
//if you want an object
yarnconverter.toObject().then((yarnObject)=>console.log(yarnObject));
//if you want a JSON file
yarnconverter.toJson().then((yarnJsonString)=>console.log(yarnJsonString));
//if you want another directory
yarnconverter.toJson("/home/www/someproject").then((yarnJsonString)=>console.log(yarnJsonString));
Credits
zimbatm - forked this project from theirs, and modified to my needs.