Comparing version 0.1.0 to 1.0.0
{ | ||
"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 @@ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
6503
5
58
1
125
3