open-index/open-npm huggingface dataset:
npm package: @hzab/cordova-plugin-chooser
Description: Cordova file chooser plugin
Author: Cyph, Inc.
Latest version: 1.4.1

# Chooser

## Demo 
[cordova-plugin-chooser-lab](https://github.com/MaximBelov/cordova-plugin-chooser-lab)

## Overview

File chooser plugin for Cordova.

Install with Cordova CLI:

	$ cordova plugin add @hzab/cordova-plugin-chooser

Supported Platforms:

* Android

* iOS

## API

	/**
	 * Displays native prompt for user to select a file.
	 *
	 * @param {Object} options
	 * @param {string} options.mimeTypes Optional MIME type filter (e.g. 'image/gif,video/*')
	 * @param {number} options.maxFileSize 
	 *
	 * @returns Promise containing selected file's 
	 * path, display name, MIME type, , and original URI.
	 *
	 * If user cancels, promise will be resolved as undefined.
	 * If error occurs, promise will be rejected.
	 */
	chooser.getFile(options?: {}) : Promise<undefined|{
		path: string;
		name: string;
		mimeType: string;
		extension: string;
		size: number;
	}>

## Example Usage

	(async () => {
		const file = await chooser.getFile();
		console.log(file ? file.name : 'canceled');
	})();


## Platform-Specific Notes

The following must be added to config.xml to prevent crashing when selecting large files
on Android:

```
<platform name="android">
	<edit-config
		file="app/src/main/AndroidManifest.xml"
		mode="merge"
		target="/manifest/application"
	>
		<application android:largeHeap="true" />
	</edit-config>
</platform>
```

If it isn't present already, you'll also need the attribute `xmlns:android="http://schemas.android.com/apk/res/android"` added to your `<widget>` tag in order for that to build successfully.
npm package: @hzab/opencv-qr
Description: You can use Opencv JS to decode QR codes in photos.
Author: leidenglai@foxmail.com
Latest version: 0.7.0

# OpencvQr
## 纯JS识别照片或图片中的二维码
本库的主要特点是：
* 纯前端处理，无须调用后端OCR API等接口；
* 可处理标准正方形的二维码，最重要的是可以处理照片上的二维码；二维码变形、旋转都可以识别；
* 基于opencv 编译后的webassembly版本，编译添加了微信开源的wechat_qrcode，有极高的识别率。


在线测试：https://leidenglai.github.io/opencv-js-qrcode/

**demo code:  [leidenglai/opencv-js-qrcode Example · GitHub](https://github.com/leidenglai/opencv-js-qrcode/tree/gh-pages?tab=readme-ov-file)**

## 加载二维码识别引擎
本库中采用的是自定义编译的opencv库作为继承，添加了三方组件wechat_qrcode微信二维码引擎，并且去掉不需要的库。封装一些基本方法方便使用。

### NPM

``` sh
npm install opencv-qr --save
```


``` javascript
// ES6 import
import OpencvQr from "opencv-qr";

// CommonJS require
const OpencvQr = require("opencv-qr");

// 加载模型文件，模型文件请自行保存在静态目录
const cvQr = new OpencvQr({
  dw: "http://xxx.com/models/detect.caffemodel",
  sw: "http://xxx.com/models/sr.caffemodel",
});

```

### Browser

也可直接在浏览器中使用

``` html
<script src="dist/OpencvQr.js"></script>
<script>
  const cvQr = new OpencvQr({
    dw: "http://xxx.com/models/detect.caffemodel",
    sw: "http://xxx.com/models/sr.caffemodel",
  });
</script>

```


### 使用

OpencvQr暴露一个加载方法和三个使用方法, 支持typescript类型 OpencvQr.d.ts

``` javascript
  // 初始化时需自行加载模型文件，模型文件请自行保存为静态文件，不可编译转换
  const cvQr = new OpencvQr({
    dw: "http://xxx.com/models/detect.caffemodel",
    sw: "http://xxx.com/models/sr.caffemodel",
  });

  // 加载canvas中的图像
  const result = cvQr.load("canvasInput");

  // 返回解析结果字符
  const infos = result?.getInfos();
  // 返回解析的二维码截取图像 ImageData
  const images = result?.getImages();
  // 返回已识别的二维码图像相对于原图的位置信息 坐标和宽高
  const sizes = result?.getSizes();

  // 清除加载图片，释放内存
  result?.clear(); 
  // or
  cvQr.clear();

```


## 浏览器兼容性：
暨WebAssembly兼容性，基本上现代浏览器都是支持的：
<img width="789" alt="CleanShot 2022-05-23 at 17 16 35@2x" src="https://user-images.githubusercontent.com/11383747/169796444-07af908a-48a6-448f-b458-56175ad2576d.png">
npm package: @hzab/pdfjs-dist
Description: Generic build of Mozilla's PDF.js library.
Latest version: 3.11.174

# PDF.js

PDF.js is a Portable Document Format (PDF) library that is built with HTML5.
Our goal is to create a general-purpose, web standards-based platform for
parsing and rendering PDFs.

This is a pre-built version of the PDF.js source code. It is automatically
generated by the build scripts.

For usage with older browsers/environments, without native support for the
latest JavaScript features, please see the `legacy/` folder.
Please see [this wiki page](https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support) for information about supported browsers/environments.

See https://github.com/mozilla/pdf.js for learning and contributing.