Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A slightly higher-level HTTP client for node

This branch is 0 commits ahead and 0 commits behind master

Merge pull request #14 from mojodna/travis

latest commit f5e496d739
Dane Springmeyer springmeyer authored
Octocat-spinner-32 bin Modernizing this module. I think that this will still November 30, 2011
Octocat-spinner-32 lib Include the invalid URL's value in the error. January 24, 2014
Octocat-spinner-32 test Test fixup January 24, 2014
Octocat-spinner-32 .npmignore Adding strong npmignore November 30, 2011
Octocat-spinner-32 .travis.yml travis: stop testing on node v0.6.x as per npm/npm#4379 January 07, 2014
Octocat-spinner-32 1.3.0 September 16, 2013
Octocat-spinner-32 LICENSE Adding license October 27, 2011
Octocat-spinner-32 Makefile switch tests to mocha February 14, 2012
Octocat-spinner-32 s/developmentseed/mapbox/ January 24, 2014
Octocat-spinner-32 package.json 1.3.0 September 16, 2013

get Build Status

get is a slightly higher-level HTTP client for nodejs.


npm install get

get has no dependencies.

For testing, you'll need make and mocha.

For docs you'll need docco.


  • Redirect following.
  • Convenience functions for downloading and getting data as string.
  • Binary-extension and basic binary detection.
  • Configurable headers


Downloads are objects in get.

var dl = new get({ uri: '' });

However, the function is a self-calling constructor, and thus the new keyword is not necessary:

var dl = get({ uri: '' });

The get constructor can also take a plain string if you don't want to give options.

var dl = get('');

It can also take other options.

var dl = get({
    uri: '',
    max_redirs: 20,

Then it exposes three main methods

dl.asString(function(err, str) {


dl.toDisk('myfile.txt', function(err, filename) {

and finally

dl.asBuffer(function(err, data) {

There's also a lower-level API.

dl.perform(function(err, response) {
    // response is just a response object, just like
    // HTTP request, except handling redirects

If you give node-get an object of settings instead of a string, it accepts

  • uri - the address of the resource
  • headers - to replace its default headers with custom ones
  • max_redirs - the number of redirects to follow before returning an error
  • no_proxy - don't use a HTTP proxy, even if one is in ENV
  • encoding - When calling .guessEncoding(), get will use this instead of the default value


var get = require('get');

get('').asString(function(err, data) {
    if (err) throw err;


  • Guessing encoding wth headers
  • User-customizable encodings


  • Tom MacWright (tmcw)
  • Konstantin Kaefer (kkaefer)
Something went wrong with that request. Please try again.