Global

Methods

extract(sourceDocument) → {Promise.<string>}

Extract content from source document and convert it to Markdown
Parameters:
Name Type Description
sourceDocument string Source document from which to extract content, see ./src/archivist/services/sourceDocument.js
Source:
Returns:
Promise which is fulfilled once the content is extracted and converted in Markdown. The promise will resolve into a string containing the extracted content in Markdown format
Type
Promise.<string>

fetch(params) → {Promise}

Fetch a resource from the network, returning a promise which is fulfilled once the response is available
Parameters:
Name Type Description
params Object Fetcher parameters
Properties
Name Type Attributes Description
url string URL of the resource you want to fetch
executeClientScripts boolean <optional>
Enable execution of client scripts. When set to `true`, this property loads the page in a headless browser to load all assets and execute client scripts before returning its content
cssSelectors string | Array <optional>
List of CSS selectors to await when loading the resource in a headless browser. Can be a CSS selector or an array of CSS selectors. Only relevant when `executeClientScripts` is enabled
config Object <optional>
Fetcher configuration
Properties
Name Type Attributes Description
navigationTimeout number <optional>
Maximum time (in milliseconds) to wait before considering the fetch failed
language string <optional>
Language (in [ISO 639-1 format](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)) to be passed in request headers
waitForElementsTimeout number <optional>
Maximum time (in milliseconds) to wait for selectors to exist on page before considering the fetch failed. Only relevant when `executeClientScripts` is enabled
Source:
Returns:
@returns {Promise} Promise which will be resolved with an object containing the `mimeType` and the `content` of the URL as string or Buffer
Type
Promise

Documentation generated by JSDoc 4.0.0 on Fri Apr 12 2024 07:21:39 GMT+0000 (Coordinated Universal Time)