Basic API for yarn.
MIT License
Basic API for yarn.
Install with npm:
$ npm install --save yarn-api
Install with yarn:
$ yarn add yarn-api
var yarn = require('yarn-api');
yarn(['why', 'isobject'], function(err) {
if (err) throw err;
});
Run yarn
with the given cmds
, args
and callback.
Params
cmds
{String|Array}
args
{String|Array}
cb
{Function}: CallbackExample
yarn(['add', 'isobject'], function(err) {
if (err) throw err;
});
Symlink the current project to global node_modules
. Visit the yarn docs for link.
Params
cb
{Function}: CallbackExample
yarn.link(function(err) {
if (err) throw err;
});
Unlink a previously created symlink for a package. Visit the yarn docs for unlink.
Params
cb
{Function}: CallbackExample
yarn.unlink(function(err) {
if (err) throw err;
});
Installs one or more packages and any packages they depend on.
Visit the yarn docs for add.
Params
names
{String|Array}: package namescb
{Function}: CallbackExample
yarn.add('isobject', function(err) {
if (err) throw err;
});
Execute yarn add --global
with one or more package names
.
Params
names
{String|Array}: One or more package names to installcb
{Function}: CallbackExample
yarn.global('mocha', function(err) {
if (err) throw err;
});
Install all dependencies for a project. This is most commonly used when you have just checked out code for a project, or when another developer on the project has added a new dependency that you need to pick up.
Visit the yarn docs for install.
Params
cb
{Function}: CallbackExample
yarn.install(function(err) {
if (err) throw err;
});
Checks for outdated package dependencies.
Visit the yarn docs for outdated
Params
names
{String|Array}: package namescb
{Function}: CallbackExample
yarn.outdated('isobject', function(err) {
if (err) throw err;
});
Updates all dependencies to their latest version based on the version range specified in the package.json file. The yarn.lock
file will be (re)created as well.
Visit the yarn docs for upgrade.
Params
cb
{Function}: CallbackExample
yarn.upgrade(function(err) {
if (err) throw err;
});
Remove a package from your direct dependencies, updating your package.json and yarn.lock files in the process.
Visit the yarn docs for remove.
Params
args
{Function}
cb
{Function}: CallbackExample
yarn.remove('isobject', function(err) {
if (err) throw err;
});
Show information about why a package is installed.
Visit the yarn docs for why.
Params
args
{Function}
cb
{Function}: CallbackExample
yarn.why('isobject', function(err) {
if (err) throw err;
});
Execute yarn add
with one or more package names
. Updates dependencies
in package.json.
Params
names
{String|Array}: One or more package names to installcb
{Function}: CallbackExample
yarn.dependencies('micromatch', function(err) {
if (err) throw err;
});
Execute yarn add --dev
with one or more package names
. Updates devDependencies
in package.json.
Params
names
{String|Array}: One or more package names to installcb
{Function}: CallbackExample
// defined as a string
yarn.devDependencies('micromatch', function(err) {
if (err) throw err;
});
// or as an array
yarn.devDependencies(['micromatch', 'is-glob'], function(err) {
if (err) throw err;
});
Execute yarn add --peer
with one or more package names
. Updates peerDependencies
in package.json.
Params
names
{String|Array}: One or more package names to installcb
{Function}: CallbackExample
yarn.peerDependencies('isobject', function(err) {
if (err) throw err;
});
Execute yarn add --optional
with one or more package names
. Updates optionalDependencies
in package.json.
Params
names
{String|Array}: One or more package names to installcb
{Function}: CallbackExample
yarn.optionalDependencies('isobject', function(err) {
if (err) throw err;
});
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on April 27, 2017.