An open API service indexing awesome lists of open source software.

https://github.com/karpeleslab/klbfw-dynfetch


https://github.com/karpeleslab/klbfw-dynfetch

Last synced: 12 months ago
JSON representation

Awesome Lists containing this project

README

          

# @karpeleslab/klbfw-dynfetch

A utility for fetching dynamically rendered HTML content from websites using Puppeteer.

## Usage with npx

You can run this tool directly without installation using npx:

```bash
npx @karpeleslab/klbfw-dynfetch
```

Example:
```bash
npx @karpeleslab/klbfw-dynfetch https://example.com
```

This will output the fully rendered HTML after JavaScript execution.

## Installation

### Global Installation

```bash
npm install -g @karpeleslab/klbfw-dynfetch
```

Then you can use it as:

```bash
klbfw-dynfetch
```

### Local Installation

```bash
npm install @karpeleslab/klbfw-dynfetch
```

## Programmatic Usage

You can also use this package programmatically in your code:

```javascript
const { fetchRenderedHtml } = require('@karpeleslab/klbfw-dynfetch');

fetchRenderedHtml('https://example.com')
.then(html => {
console.log(html);
})
.catch(error => {
console.error('Error:', error);
});
```

## Development

Clone the repository and install dependencies:

```bash
git clone https://github.com/karpeleslab/klbfw-dynfetch.git
cd klbfw-dynfetch
npm install
```

Run locally:

```bash
npm start
```

or

```bash
node src/index.js
```