@gowerstreet/fetch

1.0.1 • Public • Published

Fetch

A simple convenience wrapper around Node.js's HTTP.get function. Takes a URL and a callback function.

If you need PUT, POST, DELETE, multi-part MIME uploads, or an of the rest of that jazz, you're better off using one of the many libraries like request.

Usage

(var fetch (require "@gowerstreet/fetch"))

(fetch "http://jsonplaceholder.typicode.com/todos/1"
       (# (data) (console.log "Look what I got!" (JSON.parse data))))

TODO

  • Support HTTPS
  • Handle errors better. Or at all.

License

MIT - see the license file.

Package Sidebar

Install

npm i @gowerstreet/fetch

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

4.67 kB

Total Files

5

Last publish

Collaborators

  • ccgsa
  • chrismdp
  • nrmatgowerst