I published a small npm package that I’ve dubbed simpleragent. It’s a NodeJS simplified version of SuperAgent.js for making JSON HTTP requests.


Superagent is great! It lets you structure your requests cleanly and programmatically.

But it’s also pretty heavy - it contains lots of features that aren’t necessary for making simple JSON requests, which are most of the requests I make most of the time. If I’m bundling up a small Lambda function, it’s better to have a super small library to provide the same functionality without all the extra stuff.


  • Can probably do most of what you need for API requests
  • Has no production dependencies
  • Is small: roughly 100 lines of code
  • Is typed with Typescript
  • Has good test coverage


Easy enough:

$ npm install --save simpleragent

What’s Supported?

Basic JSON requests work just fine:

const request = require('simpleragent');

// Auth and query strings
    .auth('my-user', 'pass')
    .query({name: 'bananas'})
    .end((err, resp) => {
        // Do something

// Promises, within an async function
const resp = await request

// Sending JSON bodies, HTTPS, and setting headers
    .set('Authorization', 'Bearer ' + myApiKey)
    .send({name: 'banana', type: 'peel'})
    .then((resp) => {
        // Do something

That’s it! None of the other hefty features are supported, and that keeps the library nice and small with no external dependencies.