remote-read
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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.

Coffee PayPal

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.

Adam Zerella

Package Sidebar

Install

npm i remote-read

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

4.83 kB

Total Files

4

Last publish

Collaborators

  • azerella