1.0.0 • Published 8 years ago

jasonp v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

jasonp npm bower

A tiny module that provides a logical interface for making JSONP requests.

This is supposed to be funny because my name is Jason.

Usage

jasonp(url, callback) -> (err, ...data)

Make a JSONP request.

  • The callback is node-style (works nicely with praline).
  • Include a {{callback}} placeholder in the URL to replace it with the callback ID.
  • Requests time out after 10 seconds with err='Timed out'

Example

import get from 'jasonp';
let url = 'http://foo.com/test.json';
get(`${url}?callback={{callback}}`, (err, ...data) => {
	if (err) return console.error(err);
	console.log(...data);
});

License

MIT

1.0.0

8 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago