node-jsonp-client
Advanced tools
Comparing version 1.0.3 to 1.0.4
const { VM } = require('vm2') | ||
const fetch = require('node-fetch') | ||
module.exports = async function jsonpClient(url) { | ||
const resBody = await fetch(url).then(res => res.text()) | ||
module.exports = async function jsonpClient(url, options = {}) { | ||
const resBody = await fetch(url, options).then(res => res.text()) | ||
const callbackNameReg = /^([$\w_][\d\w_$]+)\(/ | ||
@@ -7,0 +7,0 @@ const jsonpStartReg = /^\(/ |
{ | ||
"name": "node-jsonp-client", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "a simple jsonp client for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# node-jsonp-client | ||
a simple jsonp client for Node.js | ||
## Installation | ||
````bash | ||
```bash | ||
$ npm install node-jsonp-client | ||
```` | ||
``` | ||
@@ -12,6 +15,9 @@ ## Usage | ||
````javascript | ||
const jsonpClient = require('node-jsonp-client'); | ||
```javascript | ||
const jsonpClient = require('node-jsonp-client') | ||
const http = require('http') | ||
jsonpClient('http://yourapi').then(console.log) | ||
```` | ||
jsonpClient('http://yourapi', { | ||
agent: new http.Agent({ keepAlive: true }) | ||
}).then(console.log) | ||
``` |
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
3182
23