Skip to content

Commit

Permalink
Fix the bad code snippet (#1053)
Browse files Browse the repository at this point in the history
Co-authored-by: Raine Revere <[email protected]>
  • Loading branch information
yuki and raineorshine authored Feb 28, 2022
1 parent 42320dd commit 60e18c2
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,25 +280,21 @@ For example, `.ncurc.json`:
## Module/Programmatic Usage
npm-check-updates can be required as a module:
npm-check-updates can be imported as a module:
```js
const ncu = require('npm-check-updates')
(async () => {
const upgraded = await ncu.run({
// Pass any cli option
packageFile: '../package.json',
upgrade: true,
// Defaults:
// jsonUpgraded: true,
// silent: true,
}))
console.log(upgraded) // { "mypackage": "^2.0.0", ... }
})()
import ncu from 'npm-check-updates'
const upgraded = await ncu.run({
// Pass any cli option
packageFile: '../package.json',
upgrade: true,
// Defaults:
// jsonUpgraded: true,
// silent: true,
})
console.log(upgraded) // { "mypackage": "^2.0.0", ... }
```
## Known Issues
Expand Down

0 comments on commit 60e18c2

Please sign in to comment.