github sindresorhus/got v6.0.0
6.0.0

latest releases: v14.2.1, v14.2.0, v14.1.0...
8 years ago

Aiming on Node.js 4

This release drops Node.js 0.10/0.12 support, so we replaced lots of modules and reduce dependency tree more than twice (see PR overview). Module folder size reduced from 1.1 MB to 216 KB.

For older Node.js versions we will still maintain v5.x for critical bug-fixes.

Promises by default

Callback interface was replaced by Promises, because it is a better way to work with asynchronous operations and they can be used with yield/await nicely.

If you use callback before:

got('todomvc.com', (err, body) => {
    if (err) {
        console.log(err);
        return;
    }

    console.log(body);
});

You can rewrite it this way:

got('todomvc.com')
    .then(res => {
        console.log(res.body);
    })
    .catch(err => {
        console.log(err);
    });

You can read more about Promises in "ECMAScript 6 promises (2/2): the API" post and some caveats in "We have a problem with promises".

Update

$ npm install --save got@6

Changes

v5.3.0...v6.0.0

Don't miss a new got release

NewReleases is sending notifications on new releases.