remote-read
v1.0.0
Published
Fetch and render the HTML content from a given URL.
Downloads
2
Readme
remote-read
✊ Fetch and render the HTML content from a given URL.
I'm aspiring to make open-source my full-time work. If you like the work that I do, please consider supporting me.
Install
npm i remote-read
Usage
When fetching a typical frontend framework page you'll usually see minified html and a script tag with the app bundle. Using Puppeteer we can evaluate the contents of the page to read the DOM structure when fetching a URL.
Module
const RemoteRead = require( 'remote-read' );
(async () => {
// Read remote HTML contents
let result = await RemoteRead( 'https://github.com/' );
console.log( result )
// <script src="/static/js/2.59d6cad5.chunk.js">...
// Read remote HTML rendered contents
let result = await RemoteRead( 'https://github.com/', true );
console.log( result )
// <div id="root"><main><div...
})();
Test
npm test
Contribute
Don't be scared raise an issue or a pull request! Any contributions, no matter how big or small will land your picture here.