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

node-jsonp-client

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-jsonp-client - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

4

index.js
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)
```
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