Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

polling-to-event

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polling-to-event - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"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)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc