@anmiles/downloader
v5.0.2
Published
Wrapper for downloading data as string, buffer or complex types
Downloads
13
Readme
@anmiles/downloader
Wrapper for downloading data as string, buffer or complex types
Installation
npm install @anmiles/downloader
Usage
import { download } from '@anmiles/downloader';
const buffer = await download('http://url/page');
import { download } from '@anmiles/downloader';
await download('http://url/file', '/path/to/file');
import { download } from '@anmiles/downloader';
await download('http://url/file', '/path/to/file', { append: true });
import { downloadString } from '@anmiles/downloader';
const str = downloadString('http://url/string');
import { downloadString } from '@anmiles/downloader';
const str = downloadString('http://url/base64-string', 'base64');
import { downloadJSON } from '@anmiles/downloader';
const str = downloadJSON('http://url/json');
import { downloadJSON } from '@anmiles/downloader';
const str = downloadJSON('http://url/base64-encoded-json', 'base64');