0.1.2 • Published 4 years ago

yarn-programmatic v0.1.2

Weekly downloads
1,031
License
ISC
Repository
github
Last release
4 years ago

Yarn Programmatic API

yarn-programmatic is a library that allows you to access yarn commands programmatically from Javascript.

This is still being developed to map the full feature set of Yarn. Please submit a request on Github if there is a particular command you'd like

Usage

Every function returns a Promise.


yarn.add()

yarn.add(['babel', 'react'], {dev: true});

Arguments

nametypevalue
packagesArrayList of packages to install
optionsObjectOptions object (see below)

Options

nametypedefaultvalue
devBooleanfalseSave to devDependencies

yarn.remove()

yarn.remove(['babel', 'react']);

Arguments

nametypevalue
packagesArrayList of packages to remove

yarn.info()

yarn.info(); // Get info on current package
yarn.info('react'); // Get info on 'react' package

Arguments

nametypevalue
packagestringOptional package to lookup info for