New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jullius

Light weight library to manage JSONP calls using Promises


Version published
Maintainers
1
Created

jullius

Light weight library to manage JSONP calls using Promises

Install

With npm

npm install jullius --save

Download

You can download the latest version or checkout all the releases here.

How to use?

If you know how Promises in JavaScript work and what is a JSONP call, then you don't need much else.

Require the package or use the global jullius namespace and passing a url, pipe a then statement to handle the data you've received and catch just in case something goes wrong.

JavaScript

<script src="path/to/jullius.min.js"></script>
<script>
jullius('http://www.pinceladasdaweb.com.br/blog/', {
    json: 'get_recent_posts',
    count: 5
})
.then(function(data) {
    console.dir(data);
})
.catch(function(e) {
    console.error(e);
});
</script>

commonJS

var jullius = require('jullius');

ES6

import jullius from 'jullius';

##Options

  • url: (string) (required) URL for the JSONP resource.
  • params: (object) (optional) Object used to generate GET query parameters for the JSONP resource.

##Browser Support

IEChromeFirefoxOperaSafari
IE 9+ ✔Latest ✔Latest ✔Latest ✔Latest ✔

Since this library relies on Promises remember to include a polyfill for browsers which don't support this feature. I recommend this one es6-promise developed by Jake Archibald.

Contributing

Check CONTRIBUTING.md for more information.

History

Check Releases for detailed changelog.

License

MIT

FAQs

Package last updated on 20 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts