New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

poll

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

poll - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

dist/cjs/poll.js

39

package.json
{
"name": "poll",
"version": "1.0.0",
"license": "MIT",
"description": "A simple poll function based on async, await, and an infinite loop",
"version": "0.1.0",
"keywords": [
"poll",
"async",
"await"
],
"repository": "kleinfreund/poll",
"bugs": {
"url": "https://github.com/kleinfreund/poll/issues"
},
"author": {

@@ -10,24 +19,26 @@ "name": "Philipp Rudloff",

},
"license": "MIT",
"main": "src/poll",
"engines": {
"node": ">=8"
},
"main": "dist/cjs/poll",
"module": "dist/esm/poll.mjs",
"sideEffects": false,
"files": [
"src"
"cjs",
"dist"
],
"scripts": {
"prepublishOnly": "npm test",
"test": "jest --collect-coverage"
"prepack": "npm run build",
"build": "npm run build:esm && npm run build:cjs",
"build:esm": "tsc --module esnext --outDir dist/esm && npm run rename-to-mjs",
"build:cjs": "tsc --module commonjs --outDir dist/cjs",
"test": "jest --collect-coverage",
"rename-to-mjs": "mv dist/esm/poll.js dist/esm/poll.mjs"
},
"keywords": [
"poll",
"async",
"await"
],
"bugs": {
"url": "https://github.com/kleinfreund/poll/issues"
},
"devDependencies": {
"@types/jest": "^24.0.16",
"jest": "^24.8.0"
"jest": "^24.8.0",
"typescript": "^3.5.3"
}
}

@@ -5,4 +5,9 @@ # poll

Links:
- [**npmjs.com**/package/poll](https://www.npmjs.com/package/poll)
- [**github.com**/kleinfreund/poll](https://github.com/kleinfreund/poll)
## Table of contents

@@ -19,6 +24,8 @@

Install the NPM package as a dependency …
### Browser
Download the ES module file …
```sh
npm install --save poll
curl -O https://raw.githubusercontent.com/kleinfreund/poll/main/dist/esm/poll.mjs
```

@@ -28,4 +35,4 @@

```node
const poll = require('poll');
```js
import poll from 'poll.mjs';

@@ -39,4 +46,50 @@ function fn() {

### Node
Install the node package as a dependency …
```sh
npm install --save poll
```
… and import it like this:
- CommonJS module
```node
const poll = require('poll').default;
function fn() {
console.log('Hello, beautiful!');
};
poll(fn, 1000);
```
- ES module
```js
import poll from 'poll/dist/esm/poll.mjs';
function fn() {
console.log('Hello, beautiful!');
};
poll(fn, 1000);
```
- TypeScript module
```ts
import poll from 'poll/src/poll';
function fn() {
console.log('Hello, beautiful!');
};
poll(fn, 1000);
```
## Tests

@@ -43,0 +96,0 @@

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