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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wecity/weda-plugin-ocr

v0.0.1-alpha14

Published

基于WeDa的腾讯云风格OCR插件

Downloads

5

Readme

WeDa-ORC插件

基于WeDa的腾讯云风格OCR插件

使用方法

安装

在WeDa中安装npm依赖 @wecity/weda-plugin-ocr

使用
  1. 引入依赖
    import ocr from '@wecity/weda-plugin-ocr'
  2. 调用ocr.start方法,详细参数见注释
    const result = await ocr.start({
    
      /** OCR识别类型,必填
       * 例如身份证的业务类型是IDCardOCR
       * 其他证件业务类型请在腾讯云服务端API文档对应业务的Action取值中获取
       **/
       action: 'IDCardOCR',  
    
       /**
        * 获取临时密钥的函数,必填。是一个返回 {temSecretId,temSecretKey,token}对象的异步函数
        * 为了确保数据安全,本插件只支持临时密钥,请自行部署获取临时密钥接口服务
        * 参考:https://cloud.tencent.com/document/product/866/49461#getauthorization.3A
        **/
       getAuthorization: () => {}, 
    
       /**
        * 是否禁用相册,非必填,默认为false
        **/
       disableAlbum: false,  
    
       /**
        * 选择框方向,非必填 ,默认为vertical ,可选值为 vertical、horizontal
        **/
       selectionAreaDirection: 'vertical', 
          
       /** 请求额外参数,非必填。
        * 可包含腾讯云服务端API文档中当前类型的OCR接口中除了 Action、Version、Region、ImageBase64、ImageUrl 之外的参数。
        * 如身份证识别场景中(https://cloud.tencent.com/document/product/866/33524#2.-.E8.BE.93.E5.85.A5.E5.8F.82.E6.95.B0)可按需传入 {CardSide,Config}
        **/
       ocrOption: {}
    })
    
     /** 返回值结构:
     * 如果返回值包含Error字段,则说明识别错误,请根据错误信息进行处理;
     * 否则说明识别成功,此时返回值的内容和腾讯云服务端API文档中当前类型的OCR接口返回值一致。
     * 如身份证识别场景中(https://cloud.tencent.com/document/api/866/33524#3.-.E8.BE.93.E5.87.BA.E5.8F.82.E6.95.B0)返回值为 {Name,Sex,Nation,...}
     **/ 
    if(result.Error) {
      console.error(result.Error.Message)
    }else {
      console.log(result)
    }