1.2.0 • Published 7 years ago

got-download v1.2.0

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

got-download

Build Status Test Coverage Code Climate Issue Count

How to use

import gotDownload from 'got-download';

try {
  await gotDownload('example.com/file.txt', {
    filename: path.join(__dirname, '/file.txt'),
    // any got option
  });
} catch(e) {
  // Here any file was saved. All operation are atomic.
}

Checksum

import gotDownload from 'got-download';

try {
  await gotDownload('example.com/file.txt', {
    filename: path.join(__dirname, '/file.txt'),
    checksum: 'wrongchecksum',
    algorithm: 'sha512'
    // any got option
  });
} catch(e) {
  // Either checksum or download fails. The operation still atomic
}

Download progress

import gotDownload from 'got-download';

await gotDownload('example.com/file.txt', {
  filename: path.join(__dirname, '/file.txt'),
  downloadProgress: progress => console.log(progress) // { downloaded: 512, total: 1024 }
  // any got option
});

Using CommonJS

const gotDownload = require('got-download').default;

Publish

Just merge to the master and create a git tag vPACKAGE_VERSION

1.2.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago