• Version 4.0.0
  • Published
  • 44.7 kB
  • 6 dependencies
  • MIT license


npm i get-uri
yarn add get-uri
pnpm add get-uri


Returns a `stream.Readable` from a URI string



variable protocols

const protocols: { [key: string]: GetUriProtocol };


    function getUri

    getUri: typeof getUri;
    • Async function that returns a stream.Readable instance to the callback function that will output the contents of the given URI.

      For caching purposes, you can pass in a stream instance from a previous getUri() call as a cache: stream option, and if the destination has not changed since the last time the endpoint was retreived then the callback will be invoked with an Error object with code set to "ENOTMODIFIED" and null for the "stream" instance argument. In this case, you can skip retreiving the file again and continue to use the previous payload.

      Parameter uri

      URI to retrieve

      Parameter opts

      optional "options" object

      Parameter fn

      callback function public


    interface GetUriOptions

    interface GetUriOptions {}

      property cache

      cache?: Readable;

        Type Aliases

        type GetUriCallback

        type GetUriCallback = (err?: Error | null, res?: Readable) => void;

          type GetUriProtocol

          type GetUriProtocol = (
          parsed: UrlWithStringQuery,
          opts: getUri.GetUriOptions
          ) => Promise<Readable>;

            Package Files (1)

            Dependencies (6)

            Dev Dependencies (10)

            Peer Dependencies (0)

            No peer dependencies.


            To add a badge like this badgeto your package's README, use the codes available below.

            You may also use to create a custom badge linking to

            • Markdown
            • HTML
              <a href=""><img src="" alt=""></a>