@shieldsbetter/slurp-uri

0.0.1 • Public • Published

slurp-uri

Reads the contents of a URI into a Buffer or string.

(Because I got tired of gluing get-uri to stream-to-array).

Usage

const slurpUri = require('@shieldsbetter/slurp-uri');

async function main() {
    console.log(await slurpUri('data:,hello world'), { encoding: 'utf8' });
}

Options

A second parameter may be passed containing options. Supported options:

  • encoding - (Optional) If specified, the URI's bytes will be decoded and returned as a string with the specified encoding. If omitted, the raw Buffer will be returned.
  • getUriOptions - (Optional - default {}) Passed verbatim to get-uri.

Readme

Keywords

none

Package Sidebar

Install

npm i @shieldsbetter/slurp-uri

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

1.89 kB

Total Files

3

Last publish

Collaborators

  • shieldsbetter