polling-to-event
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "polling-to-event", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Receive events with EventEmitter from a polling function ran on an interval", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,7 +5,7 @@ # node-polling-to-event | ||
##Installation | ||
## Installation | ||
$ npm install polling-to-event | ||
##Usage | ||
## Usage | ||
@@ -29,3 +29,3 @@ var pollingtoevent = require("polling-to-event"); | ||
##Example | ||
## Example | ||
@@ -51,5 +51,5 @@ var pollingtoevent = require("polling-to-event"), | ||
##API | ||
## API | ||
### pollingtoevent(pollingfunction, options) | ||
#### pollingtoevent(pollingfunction, options) | ||
@@ -67,25 +67,15 @@ It returns a NodeJS [EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter) that emits the polled data on an interval. | ||
### Events | ||
**Returns** - Returns an `events.EventEmitter` instance. | ||
#### interval | ||
#### Events | ||
Emitted when an interval has completed and the `done()` function was called with no errors. *You can also customize this event's name using the option `eventName`*. | ||
* `interval` - Emitted when an interval has completed and the `done()` function was called with no errors. *You can also customize this event's name using the option `eventName`*. **Arguments**: By listening to this event, you get on the listener the arguments passed by you to `done()` after the first argument. | ||
**Arguments** | ||
* `error` - Emitted when `done()` was called with an error. It emits the data polled by your polling function. **Arguments**. A NodeJS error object. | ||
By listening to this event, you get on the listener, the arguments passed by you to `done()` after the first argument. | ||
## TODO | ||
#### error | ||
Emitted when `done()` was called with an error. It emits the data polled by your polling function. | ||
**Arguments** | ||
* `error`: A NodeJS error object. | ||
##TODO | ||
* Add a default behaviour to poll URLs via a `GET` request if an URL string is passed as argument instead of a function. | ||
#License | ||
##License | ||
@@ -92,0 +82,0 @@ The MIT License (MIT) |
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
8328
98