https://github.com/karinjs/puppeteer-core
轻量 高效 易用 的 Puppeteer 网页截图、视频捕获工具
https://github.com/karinjs/puppeteer-core
Last synced: 4 months ago
JSON representation
轻量 高效 易用 的 Puppeteer 网页截图、视频捕获工具
- Host: GitHub
- URL: https://github.com/karinjs/puppeteer-core
- Owner: KarinJS
- License: mit
- Created: 2024-09-07T23:06:35.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-27T02:21:22.000Z (over 1 year ago)
- Last Synced: 2025-10-10T12:34:28.520Z (8 months ago)
- Language: TypeScript
- Homepage:
- Size: 70.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @karinjs/puppeteer-core
## 描述
轻量·高效·易用的 Puppeteer 截图、视频生成工具。
## 安装
```bash
npm install @karinjs/puppeteer-core
```
## 使用方法
```javascript
import fs from 'fs'
import Puppeteer from '@karinjs/puppeteer-core'
// 使用示例
const chrome = new Puppeteer()
await chrome.init()
/** 计算耗时 */
console.time('截图耗时')
const image = await chrome.screenshot({
file: 'https://baidu.com/',
fullPage: true,
pageGotoParams: {
waitUntil: 'networkidle2',
},
type: 'png',
setViewport: {
deviceScaleFactor: 3,
},
})
console.timeEnd('截图耗时')
fs.writeFileSync('image.png', image)
process.exit(0)
```
## 许可证
本项目使用 [MIT License](https://opensource.org/licenses/MIT) 许可协议。详见 `LICENSE` 文件。
## 使用的第三方库
本项目使用了以下开源库:
- **puppeteer-core**: 用于浏览器自动化操作,使用了 [Apache License 2.0](https://github.com/puppeteer/puppeteer/blob/main/LICENSE) 许可协议。
## 贡献
欢迎贡献代码和建议!