
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@redbuck/cropper
Advanced tools
npm install @redbuck/cropper 或者 yarn add @redbuck/cropper.const Cropper = require('@redbuck/cropper').
ES6 module: import Cropper from "@redbuck/cropper".<script type="text/javascript" src="to/path/cropper.js"></script>const cropper = new Cropper(el, options).| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| el | Element 丨 string | undefined | 截图组件挂载位置 |
| options | Object | {} | 配置对象 |
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| url | string | "" | 需要截取的图片地址 |
| width | number | 600 | 容器宽度 |
| height | number | 375 | 容器高度 |
| window | object | null | 截图框的 rect |
| wheelSpeed | number | 0.05 | 缩放步长 |
| maxRate | number | 10 | 最大放大倍数 |
| minRate | number | 1 | 最小放大倍数 |
| cropMode | string | 'cover' | 截图模式 |
| maskColor | string | 'rgba(0,0,0,0.6)' | 蒙层颜色 |
| devicePixelRatio | number | window.devicePixelRatio | dpr |
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| x | number | 0 | 截图框的横坐标 |
| y | number | 0 | 截图框的纵坐标 |
| width | number | options.width/2 | 截图框的宽度 |
| height | number | 0 | 截图框的高度 |
| resizeable | boolean | true | 是否允许改变截图框 |
| moveable | boolean | true | 是否允许移动截图框 |
接口定义: output(options?: OutputType): string | Blob | Error;
参数定义:
type OutputType = {
mime?: string,
type?: string,
quality?: number
};
接口定义: moveTo(x: number, y: number): void;
接口定义: zoom(origin: { x: number; y: number }, direction: number): void;
参数定义: origin 指缩放发生的坐标(canvas 坐标),delta 指方向(放大 1,缩小-1)
接口定义: changeImage(img: HTMLImageElement | string, callback?: Function):void
FAQs
A tiny image cropper
We found that @redbuck/cropper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.