0.6.3 • Published 8 years ago

fetch-one v0.6.3

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

Fetch one

Very opinionated one-function package for doing HTTP requests from Node.js (using request) and the browser if you're using something compatible with Browserify.

Returning (bluebird) promises resolving to a response object (read source for details) having code, mesage, headers and body properties. If the code is not in the 200 range, the response will be thrown instead.

var fetch = require('fetch-one');

fetch('GET', 'https://google.com', { q: 'peace' }, {
	'X-Progress': 'Half way there'
});

fetch('POST', 'http://example', {
	field: 'value',
	nested: {
		field: 'value',
	},
})

I just needed something simple that worked in both environments and without a lot of bells and whistles. It is probably inadequate for most other use cases than mine.

I hope it will some day be replaced by a "universal" version of the new fetch API.

0.6.3

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago