1.0.3 • Published 7 years ago

co-eachseries v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

co-eachseries (Each series with ES6 generator co)

This package allow you to loop asynchronously over an array or object, step by step, similar to the async.eachSeries package.

Install

npm install co-eachseries --save

Install & Run example

npm install co-eachseries --dev

Example

const co = require('co')
const wait = require('co-wait')
const eachSeries = require('co-eachseries')

co(function* () {
  const array = ['one', 'two', 'three']
  const obj = {one: '1', two: '2', three:'3'} // work with object too
  try {
    yield eachSeries(array, function * (value, index) {
      console.log(value, index)
      yield wait(1000)
    })
  } catch (err) {
    console.log(err)
  }
})
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago