experimental

net/url

The net/url module enables you to read content from a URI.

API Reference

Functions

readURI(uri, options)

Reads a URI and returns a promise.

uri : string

The URL, as a string, to load.

[ options : object ]

options can have any or all of the following fields:

[ sync = false : boolean ]

If this option is set to true, the promise returned will be resolved synchronously. Defaults to false if not provided.

[ charset = "UTF-8" : string ]

The character set to use when read the content of the uri given. Defaults to UTF-8 if not provided.

Returns: promise

The promise that will be resolved with the content of the URL given.