fetch-cheerio-object

1.3.0 • Public • Published

fetch-cheerio-object

npm version Build Status Coverage Status

A Node.js module to fetch an HTML and parse it as a cheerio object

const fetchCheerioObject = require('fetch-cheerio-object');
 
(async () => {
  const $ = await fetchCheerioObject('https://example.org/');
  $('title').text(); //=> 'Example Domain'
})();

Installation

Use npm.

npm install fetch-cheerio-object

API

const fetchCheerioObject = require('fetch-cheerio-object');

fetchCheerioObject(url [, options])

url: string
options: Object (directly passed to cheerio.load())
Return: Promise<Object>

The API is quite similar to the node-fetch's. The only difference between them is that fetch-cheerio-object parses fetched contents as a cheerio object and returns a Promise for it.

License

ISC License © 2017 - 2018 Shinnosuke Watanabe

Package Sidebar

Install

npm i fetch-cheerio-object

Weekly Downloads

35

Version

1.3.0

License

ISC

Unpacked Size

3.54 kB

Total Files

4

Last publish

Collaborators

  • shinnn