1.0.2 • Published 6 years ago

yarn-lock-convert v1.0.2

Weekly downloads
21
License
ISC
Repository
github
Last release
6 years ago

npm version

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.

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago