npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cstu-fork/taro-signature-pad

v0.0.1

Published

taro3手写签名库

Readme

taro-signature-pad

当前为fork@yz1311/taro-signature-pad,添加了一些方法

taro的手写签名库

只支持taro3小程序,h5没有做兼容处理,只支持Canvas type="2d"

安装

npm install @cstu-fork/taro-signature-pad --save

使用

import { SignaturePad } from "@cstu-fork/taro-signature-pad";

...
//组件默认是100%高宽

<Signature
    className="signature-canvas"
    ref={signatureRef}
/>

方法

isEmpty(): boolean

判断是否签名是空白的

fromDataURL(dataUrl, options, callback): void

还原签名数据

  • dataUrl: 图片的base64数据
  • options: 选项
  • callback: 回调方法

toDataURL(type, encoderOptions): string

获取签名数据

默认为png图片,实际调用的canvas的toDataURL函数,参考:

https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement/toDataURL

clear(): void

清空签名数据

save(isSaveImageToPhotosAlbum?: boolean): void

将签名数据转换为png图片并且保存到系统相册

rotateSave(angle: number, isSaveImageToPhotosAlbum?: boolean): Promise

旋转签名数据并且保存到系统相册

  • angle: 旋转角度
  • isSaveImageToPhotosAlbum: 是否保存到系统相册

返回值为图片存储地址

rotateToDataURL(angle: number, type?: string, encoderOptions?: number): string

旋转签名数据并且转换为base64编码

  • angle: 旋转角度
  • type: 图片类型
  • encoderOptions: 图片质量

返回值为图片的base64数据

signaturePadRef: React.Ref

签名板实例引用

截图