https://github.com/rhdeck/yarnif
Functions wrapping common yarn and npm use cases, using the former if available
https://github.com/rhdeck/yarnif
Last synced: over 1 year ago
JSON representation
Functions wrapping common yarn and npm use cases, using the former if available
- Host: GitHub
- URL: https://github.com/rhdeck/yarnif
- Owner: rhdeck
- License: mit
- Created: 2017-12-08T18:37:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-24T12:33:08.000Z (about 6 years ago)
- Last Synced: 2025-01-22T00:35:30.300Z (over 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yarnif
Exposes functions for running yarn or npm for package management
# Usage
```
yarnif = require('yarnif');
//...Assuming you have set cwd to the project base you want to modify
yarnif.addDependency('mypackage');
```
# Functions:
## useYarn([doUseYarn])
**Boolean** Whether to use `yarn` for other functions. Pass a boolean
`doUseYarn` value to force future calls to use yarn or npm going forward in this
runtime.
## addDependency(dependency)
Installs and saves dependency to `./package.json`
## addDevDependency
Installs and saves development dependency to `./package.json`
## addPeerDependency
Installs and saves peer dependency to `./package.json`