1.0.0 • Published 8 years ago
series-logger v1.0.0
series-logger
Log a series w/ spinner and op count
Made with ❤ at @outlandish
Install
npm install --save series-loggeryarn add series-loggerImport
// ES2015
import log from 'series-logger' // CommonJS
var log = require('series-logger') Usage
series(number) : Function
- number {Number} The number of log operations in the series
Returns a function that can be called number times.
Each invocation should be passed a message and returns an instance of ora.
For details on ora see it's GitHub repo.
Example
const log = series(5)
var operation = log('first operation').start()
//=> {spinner} [1/5] first operation
doSomethingAsync()
.then(() => operation.success()) //=> {tick} [1/5] first operation
.catch(() => operation.fail()) //=> {cross} [1/5] first operation
log('second operation').start()
//=> {spinner} [2/5] second operation
// ...and so onLicense
MIT © Sam Gluck
Contributing
All pull requests and issues welcome!
If you're not sure how, check out the great video tutorials on egghead.io!
1.0.0
8 years ago