heroku-cli-util
Advanced tools
Comparing version 5.9.0 to 5.9.1
@@ -93,3 +93,3 @@ 'use strict'; | ||
col.width = Math.max( | ||
col.label.length, | ||
_.result(col, 'label').length, | ||
col.width, | ||
@@ -96,0 +96,0 @@ calcWidth(cell) |
{ | ||
"name": "heroku-cli-util", | ||
"version": "5.9.0", | ||
"version": "5.9.1", | ||
"description": "Set of helpful CLI utilities", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,36 +18,14 @@ # heroku-cli-util | ||
```js | ||
let cli = require('heroku-cli-util'); | ||
let promise = heroku.apps(appname).info(); | ||
let app = yield cli.action('getting apps', promise); | ||
console.log(`app name: ${app.name}`); | ||
let cli = require('heroku-cli-util'); | ||
yield cli.action('restarting dynos', co(function* () { | ||
let app = yield heroku.get(`/apps/${context.app}`); | ||
yield heroku.request({method: 'DELETE', path: `/apps/${app.name}/dynos`}); | ||
})); | ||
// getting apps... done | ||
// app name: appname | ||
// restarting dynos... done | ||
``` | ||
Note: to use `yield` you need to wrap this in a [co](https://github.com/tj/co) block. | ||
## Prompt | ||
Callback style | ||
```js | ||
let cli = require('heroku-cli-util'); | ||
cli.prompt('email', {}, function (_, email) { | ||
console.log(`your email is: ${email}`); | ||
}); | ||
``` | ||
Promise style | ||
```js | ||
let cli = require('heroku-cli-util'); | ||
cli.prompt('email', {}).then(function (email) { | ||
console.log(`your email is: ${email}`); | ||
}); | ||
``` | ||
Generator style (must be wrapped in a [co](https://github.com/tj/co) block) | ||
```js | ||
let cli = require('heroku-cli-util'); | ||
@@ -54,0 +32,0 @@ let email = yield cli.prompt('email', {}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68538
255