net/url

Experimental

Enables you to read content from a URI.

Globals

Functions

readURI(uri, options)

Reads a URI and returns a promise.

Parameters

uri : string
The URL, as a string, to load.

options : object
Optional options:

Name Type
sync boolean

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

charset 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.