index.js
function AsyncSimpleIterator (options) {
  if (!(this instanceof AsyncSimpleIterator)) {
    return new AsyncSimpleIterator(options)
  }
  this.defaultOptions(options)
  AppBase.call(this)
  this.on = utils.emitter.compose.call(this, 'on', this.options)
  this.off = utils.emitter.compose.call(this, 'off', this.options)
  this.once = utils.emitter.compose.call(this, 'once', this.options)
  this.emit = utils.emitter.compose.call(this, 'emit', this.options)
}
function AsyncSimpleIterator (options) {
  if (!(this instanceof AsyncSimpleIterator)) {
    return new AsyncSimpleIterator(options)
  }
  this.defaultOptions(options)
  AppBase.call(this)
  this.on = utils.emitter.compose.call(this, 'on', this.options)
  this.off = utils.emitter.compose.call(this, 'off', this.options)
  this.once = utils.emitter.compose.call(this, 'once', this.options)
  this.emit = utils.emitter.compose.call(this, 'emit', this.options)
}
function AsyncSimpleIterator ( options ) { if ( ! ( this instanceof AsyncSimpleIterator ) ) { return new AsyncSimpleIterator ( options ) } this . defaultOptions ( options ) AppBase . call ( this ) this . on = utils . emitter . compose . call ( this , 'on' , this . options ) this . off = utils . emitter . compose . call ( this , 'off' , this . options ) this . once = utils . emitter . compose . call ( this , 'once' , this . options ) this . emit = utils . emitter . compose . call ( this , 'emit' , this . options ) }
> Initialize `AsyncSimpleIterator` with `options`.

**Example**

```js
var ctrl = require('async')
var AsyncSimpleIterator = require('async-simple-iterator').AsyncSimpleIterator

var fs = require('fs')
var base = new AsyncSimpleIterator({
settle: true,
beforeEach: function (val) {
console.log('before each:', val)
},
error: function (err, res, val) {
console.log('on error:', val)
}
})
var iterator = base.wrapIterator(fs.stat, {
afterEach: function (err, res, val) {
console.log('after each:', val)
}
})

ctrl.map([
'path/to/existing/file.js',
'filepath/not/exist',
'path/to/file'
], iterator, function (err, results) {
// => `err` will always be null, if `settle:true`
// => `results` is now an array of stats for each file
})
```

@param {Object=} `options` Pass `beforeEach`, `afterEach` and `error` hooks or `settle:true`.
@api public
> Initialize AsyncSimpleIterator with options .