fs-cheerio
DOM manipulation file system utilities. Combines Node's fs module with cheerio.
Install
npm install fs-cheerio --save
Usage
fs-cheerio allows you to read and write files to/from cheerio objects.
Note: While some of the below examples use async/await syntax, fs-cheerio will work with any Node version that supports Promises (or if you include a Promise polyfill).
readFile
Read from a file and create a cheerio object that can be manipulated. Returns a Promise that will resolve with the cheerio object.
const fsc = ; fsc;
This works even better with async/await:
const fsc = ; { let $ = await fsc;};
writeFile
Write a cheerio object to a file. Returns a Promise that will resolve once the file has been written.
var fsc = ; { let $ = await fsc; text"i changed this"; await fsc; };
License
BSD 2 Clause