Package Exports
- yarn-lock-convert
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yarn-lock-convert) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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-convertor
NPM
npm install yarn-lock-convertUsage
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.