New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dom-capture

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom-capture - npm Package Compare versions

Comparing version 1.0.1 to 1.0.3

2

dist/config.js
/**
* Created by rockyl on 2021/1/26.
*/
export var debugMode = window['html-shot/debug-mode'] || false;
export var debugMode = window['dom-capture/debug-mode'] || false;

@@ -12,2 +12,2 @@ /**

*/
export declare function htmlShot(el?: HTMLElement, options?: RenderOptions, callback?: (HTMLCanvasElement: any) => void): Promise<HTMLCanvasElement | string>;
export declare function capture(el?: HTMLElement, options?: RenderOptions, callback?: (HTMLCanvasElement: any) => void): Promise<HTMLCanvasElement | string>;

@@ -13,4 +13,4 @@ /**

*/
export function htmlShot(el, options, callback) {
export function capture(el, options, callback) {
return toCanvas(parseDom(el), options, callback);
}
{
"name": "dom-capture",
"version": "1.0.1",
"version": "1.0.3",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

@@ -5,9 +5,11 @@ # HTML截图

## Install
`yarn add html-shot`
`yarn add dom-capture`
or
`npm i html-shot`
`npm i dom-capture`
## Usage
```js
const result = await htmlShot(document.getElementById('poster'));
import {capture} from 'dom-capture'
const result = await capture(document.getElementById('poster'));
let img = new Image();

@@ -19,10 +21,10 @@ img.src = result;

## RenderOptions
| 名称 | 类型 | 必须 | 默认值 | 说明 |
| :---- | :---- | :---- | :---- | :---- |
| `type` | 'canvas' &#124; 'jpeg' &#124; 'png' | 否 | 'png' | 导出类型 |
| `qaulity` | number | 否 | 0.7 | 导出图片质量 |
| 名称 | 类型 | 必须 | 默认值 | 说明 |
|:----------|:---------------------------------------------------|:----|:-------|:-------|
| `type` | 'canvas' &#124; 'jpeg' &#124; 'png' &#124; 'blob' | 否 | 'png' | 导出类型 |
| `qaulity` | number | 否 | 0.7 | 导出图片质量 |
## 开启调试
```js
window['html-shot/debug-mode'] = true
window['dom-capture/debug-mode'] = true
```

@@ -29,0 +31,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc