Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andersdjohnson/danger-yarn-lock
Danger check that yarn.lock is updated with package.json dependencies.
https://github.com/andersdjohnson/danger-yarn-lock
Last synced: 16 days ago
JSON representation
Danger check that yarn.lock is updated with package.json dependencies.
- Host: GitHub
- URL: https://github.com/andersdjohnson/danger-yarn-lock
- Owner: AndersDJohnson
- License: mit
- Created: 2017-05-06T15:47:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T19:56:51.000Z (almost 2 years ago)
- Last Synced: 2024-10-08T16:09:35.134Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 182 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# danger-yarn-lock
> [Danger] check that yarn.lock is updated with package.json dependencies.Alternatively, look at `yarn check` or `yarn install --frozen-lockfile`.
## Install
```
yarn add -D danger-yarn-lock
```## Use
In your `Dangerfile.js`:
```js
var checkYarnLock = require('danger-yarn-lock')schedule(function (resolved) {
checkYarnLock(function (err, message) {
if (err) throw err
warn(message)
resolved()
})
})
```Or with promise:
```js
var checkYarnLock = require('danger-yarn-lock')schedule(function (resolved) {
checkYarnLock()
.then(function (message) {
warn(message)
resolved()
})
})
```Combine with other promises:
```js
var checkYarnLock = require('danger-yarn-lock')var promise = danger.git.JSONDiffForFile('other-file.txt')
.then(function () {
return 'ok'
})schedule(function (resolved) {
Promise.all([promise, checkYarnLock()])
.then(function (results) {
warn(results[1])
resolved()
})
})
```## Etc.
If you want to catch this from within npm scripts (e.g. `preinstall`), try [use-yarn](https://github.com/AndersDJohnson/use-yarn).
## Related
* [check-yarn-lock](https://www.npmjs.com/package/check-yarn-lock)
[danger]: http://danger.systems/js/