https://github.com/karpeleslab/klbfw-dynfetch
https://github.com/karpeleslab/klbfw-dynfetch
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/karpeleslab/klbfw-dynfetch
- Owner: KarpelesLab
- Created: 2025-03-17T00:07:27.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-17T00:12:31.000Z (about 1 year ago)
- Last Synced: 2025-03-17T01:26:03.254Z (about 1 year ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```