9 ms·
Hello, author here. I thought I'd make this because I couldn't find a library that was tiny, and opinionated about using promises and sane defaults (JSON header
by antihero 12y ago
Hello, author here. I thought I'd make this because I couldn't find a library that was tiny, and opinionated about using promises and sane defaults (JSON headers, for instance), and exposed the bits of XMLHttpRequest that I wanted. It actually does very little, but provides some nice little helpers to do AJAX requests. Everything is override-able. I'm toying with even making the basic Object.assign and Promise calls injectable too (see this branch: https://github.com/radiosilence/xr/blob/compat/src/xr.js https://github.com/radiosilence/xr/blob/compat/src/xr.js) but it makes the code a bit uglier.
The other handy feature is that it will use whichever Promise library that's available in the global namespace, so as long as that conforms to the spec, it will happily work with it.
Also, title should be lower case, as with most node modules.
- pseudobry 12y agoHave you seen https://github.com/mzabriskie/axios https://github.com/mzabriskie/axios?
- antihero 12y agoHaven't seen it, no. Looks neat, but a bit more complex than what I was going for. This is basically a nicer interface to XHR, intended for people who are happy to read up on the XHR API and use that for anything more complicated.
- deleted 12y ago[deleted]