2.2.0 • Published 3 years ago

node-jsonp-v2 v2.2.0

Weekly downloads
23
License
MIT
Repository
github
Last release
3 years ago

node-jsonp

Build Status Coverage Status

A simple JSONP implementation for Node.js.

Installation

$ npm install node-jsonp

API

JSONP(url, data, method, callback)

  • url (String) The URL you are requesting with the JSON data
  • data (Object) The Data object you want to generate the URL params from
  • method (String) The method name for the callback function. Defaults to callback (for example, flickr's is "jsoncallback")
  • callback (function) The callback you want to execute as an anonymous function. The first parameter of the anonymous callback function is the JSON

The callback is called with data parameters.

Example

const JSONP = require('node-jsonp-v2');

JSONP('http://jsfiddle.net/echo/jsonp/?first=Hello%20&b=World', json => {
    console.log(json);
});

License

MIT

2.2.0

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago