Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sec-ant/zxing-wasm

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sec-ant/zxing-wasm - npm Package Compare versions

Comparing version 2.1.6 to 2.2.0

dist/core-bcd69edc.js

6

dist/full/index.js

@@ -1,3 +0,3 @@

import { g as ci, r as vi, d as N, a as di, w as hi, c as J } from "../core-d8c798a7.js";
import { Z as Pi, b as Ti, p as Ai, s as Ei } from "../core-d8c798a7.js";
import { g as ci, r as vi, d as N, a as di, w as hi, c as J } from "../core-bcd69edc.js";
import { Z as Pi, b as Ti, p as Ai, s as Ei } from "../core-bcd69edc.js";
var De = (() => {

@@ -1083,3 +1083,3 @@ var W = import.meta.url;

}, Ct(), mt(), Rt(), gr = f.UnboundTypeError = jt(Error, "UnboundTypeError"), It(), xt();
var Dn = { r: Qr, v: et, a: tt, h: nt, m: it, K: at, R: st, p: ot, ba: ut, d: rt, pa: ft, Y: lt, ga: dt, oa: Wt, na: Mt, E: Ht, fa: Yt, V: Bt, F: Lt, y: zt, t: Xt, U: qt, N: nn, L: an, qa: sn, ha: on, ca: br, ma: ln, W: cn, ka: dn, la: hn, M: pn, ea: _n, da: mn, $: wn, aa: Cn, J: qn, T: si, D: Qn, q: Xn, b: kn, B: Zn, ia: ri, c: Hn, j: Un, i: Wn, o: Kn, Q: Gn, w: zn, I: ni, P: ii, C: ei, H: oi, Z: fi, X: li, k: In, e: Mn, f: jn, g: On, O: ai, l: Ln, ja: Jn, n: xn, S: Yn, u: Bn, x: Nn, A: ti, s: Vn, G: ui, z: Pn, _: Rn }, T = Kr(), Y = f._free = (e) => (Y = f._free = T.ta)(e), Ne = f._malloc = (e) => (Ne = f._malloc = T.ua)(e), Dr = (e) => (Dr = T.wa)(e);
var Dn = { r: Qr, v: et, a: tt, h: nt, m: it, K: at, R: st, p: ot, ba: ut, d: rt, pa: ft, Y: lt, ga: dt, oa: Wt, na: Mt, E: Ht, fa: Yt, V: Bt, F: Lt, y: zt, t: Xt, U: qt, N: nn, L: an, qa: sn, ha: on, ca: br, ma: ln, W: cn, ka: dn, la: hn, M: pn, ea: _n, da: mn, $: wn, aa: Cn, J: qn, T: si, D: Qn, q: Xn, b: kn, B: Zn, ia: ri, c: Hn, i: Un, j: Wn, o: Kn, Q: Gn, w: zn, I: ni, P: ii, C: ei, H: oi, Z: fi, X: li, k: In, e: Mn, f: jn, g: On, O: ai, l: Ln, ja: Jn, n: xn, S: Yn, u: Bn, x: Nn, A: ti, s: Vn, G: ui, z: Pn, _: Rn }, T = Kr(), Y = f._free = (e) => (Y = f._free = T.ta)(e), Ne = f._malloc = (e) => (Ne = f._malloc = T.ua)(e), Dr = (e) => (Dr = T.wa)(e);
f.__embind_initialize_bindings = () => (f.__embind_initialize_bindings = T.xa)();

@@ -1086,0 +1086,0 @@ var _ = (e, r) => (_ = T.ya)(e, r), ce = (e) => (ce = T.za)(e), g = () => (g = T.Aa)(), y = (e) => (y = T.Ba)(e), kr = (e) => (kr = T.Ca)(e), Or = (e) => (Or = T.Da)(e), jr = (e, r, t) => (jr = T.Ea)(e, r, t), Wr = (e) => (Wr = T.Fa)(e);

@@ -1,3 +0,3 @@

import { g as li, r as ci, d as B, a as vi } from "../core-d8c798a7.js";
import { Z as bi, b as wi, c as Ci, p as Pi, s as Ti } from "../core-d8c798a7.js";
import { g as li, r as ci, d as B, a as vi } from "../core-bcd69edc.js";
import { Z as bi, b as wi, c as Ci, p as Pi, s as Ti } from "../core-bcd69edc.js";
var Ve = (() => {

@@ -4,0 +4,0 @@ var Y = import.meta.url;

@@ -1,3 +0,3 @@

import { g as Vt, w as Bt, c as D } from "../core-d8c798a7.js";
import { Z as Kt, b as Jt, d as Qt, p as Yt, s as rn } from "../core-d8c798a7.js";
import { g as Vt, w as Bt, c as D } from "../core-bcd69edc.js";
import { Z as Kt, b as Jt, d as Qt, p as Yt, s as rn } from "../core-bcd69edc.js";
var Gr = (() => {

@@ -736,3 +736,3 @@ var I = import.meta.url;

}, Te(), Ee(), Dr = f.UnboundTypeError = Ve(Error, "UnboundTypeError");
var $t = { u: ue, v: le, a: de, k: _e, s: he, M: pe, m: ge, f: ve, O: ye, F: me, J: Ae, I: Re, A: Pe, N: Ne, r: Le, p: qe, z: rt, w: st, Q: ft, P: ct, K: ut, C: Or, E: dt, x: _t, D: gt, y: yt, H: mt, G: At, t: It, b: Et, e: kt, l: jt, h: Ft, j: Mt, L: Dt, i: Wt, d: Rt, g: Ot, c: xt, o: Pt, n: Ct, q: St, B: Ut, R: Tt }, h = ce(), pr = f._malloc = (r) => (pr = f._malloc = h.U)(r), k = f._free = (r) => (k = f._free = h.V)(r), Zr = (r) => (Zr = h.X)(r);
var $t = { u: ue, v: le, a: de, l: _e, s: he, M: pe, m: ge, f: ve, O: ye, F: me, J: Ae, I: Re, A: Pe, N: Ne, r: Le, p: qe, z: rt, w: st, Q: ft, P: ct, K: ut, C: Or, E: dt, x: _t, D: gt, y: yt, H: mt, G: At, t: It, b: Et, e: kt, k: jt, h: Ft, j: Mt, L: Dt, i: Wt, d: Rt, g: Ot, c: xt, o: Pt, n: Ct, q: St, B: Ut, R: Tt }, h = ce(), pr = f._malloc = (r) => (pr = f._malloc = h.U)(r), k = f._free = (r) => (k = f._free = h.V)(r), Zr = (r) => (Zr = h.X)(r);
f.__embind_initialize_bindings = () => (f.__embind_initialize_bindings = h.Y)();

@@ -739,0 +739,0 @@ var p = (r, e) => (p = h.Z)(r, e), K = (r) => (K = h._)(r), g = () => (g = h.$)(), y = (r) => (y = h.aa)(r), Nr = (r) => (Nr = h.ba)(r), Xr = (r) => (Xr = h.ca)(r), Lr = (r, e, t) => (Lr = h.da)(r, e, t), qr = (r) => (qr = h.ea)(r);

@@ -5,3 +5,3 @@ {

"private": false,
"version": "2.1.6",
"version": "2.2.0",
"type": "module",

@@ -21,3 +21,3 @@ "files": [

"type": "git",
"url": "https://github.com/Sec-ant/zxing-wasm"
"url": "git+https://github.com/Sec-ant/zxing-wasm.git"
},

@@ -72,3 +72,3 @@ "homepage": "https://github.com/Sec-ant/zxing-wasm",

"cross-env": "^7.0.3",
"eslint": "^8.51.0",
"eslint": "^8.52.0",
"npm-check-updates": "^16.14.6",

@@ -75,0 +75,0 @@ "playwright": "^1.39.0",

# @sec-ant/zxing-wasm
[![npm](https://img.shields.io/npm/v/@sec-ant/zxing-wasm)](https://www.npmjs.com/package/@sec-ant/zxing-wasm/v/latest) [![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/@sec-ant/zxing-wasm)](https://www.npmjs.com/package/@sec-ant/zxing-wasm/v/latest) [![jsDelivr hits (npm scoped)](https://img.shields.io/jsdelivr/npm/hm/@sec-ant/zxing-wasm?color=%23ff5627)](https://cdn.jsdelivr.net/npm/@sec-ant/zxing-wasm@latest/)
An ES module wrapper of [zxing-wasm-build](https://github.com/Sec-ant/zxing-wasm-build). Read or write barcodes in your browser!

@@ -23,7 +25,7 @@

This package exports 3 subpaths: full, reader and writer. You can choose whichever fits your needs. However, bear in mind that [subpath imports needs a `moduleResolution` of `node16` or `nodenext` in your `tsconfig.json` file](https://github.com/microsoft/TypeScript/issues/44848#issuecomment-1212826554).
This package exports 3 subpaths: `full`, `reader` and `writer`. You can choose whichever fits your needs. If you use TypeScript, you should set [`moduleResolution`](https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution) to `bundler`, `node16` or `nodenext` in your `tsconfig.json` file to properly resolve the exported module.
### `@sec-ant/zxing-wasm` or `@sec-ant/zxing-wasm/full`
These imports includes functions to both read and write barcodes. The wasm binary size is ~1.25 MB.
These 2 subpaths include functions to both read and write barcodes. The wasm binary size is ~1.26 MB.

@@ -50,3 +52,3 @@ ```ts

This subpath only includes functions to read barcodes. The wasm binary size is ~968 KB.
This subpath only includes functions to read barcodes. The wasm binary size is ~976 KB.

@@ -62,3 +64,3 @@ ```ts

This subpath only includes functions to write barcodes. The wasm binary size is ~380 KB.
This subpath only includes functions to write barcodes. The wasm binary size is ~383 KB.

@@ -71,3 +73,3 @@ ```ts

These are 2 functions to read barcodes.
These 2 functions are for reading barcodes.

@@ -82,3 +84,3 @@ `readBarcodesFromImageFile` accepts an image [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob) or an image [`File`](https://developer.mozilla.org/docs/Web/API/File) as the first input. They're encoded images, e.g. `.png` `.jpg` files.

interface ZXingReadOptions {
/* Try better to find barcodes, default = true */
/* Try harder to find barcodes, default = true */
tryHarder?: boolean;

@@ -117,3 +119,3 @@ /* An array of barcode formats to detect, default = [] (indicates any format) */

The return result of these 2 functions is a `Promise` of an array of `ZXingReadOutput`:
The return result of these 2 functions is a `Promise` of an array of `ZXingReadOutput`s:

@@ -205,3 +207,3 @@ ```ts

There is currently only 1 function to write barcodes. The first argument of this function is a text string to be encoded and the second argument is a `ZXingWriteOptions`:
There is only 1 function to write barcodes. The first argument of this function is a text string to be encoded and the second argument is a `ZXingWriteOptions`:

@@ -281,3 +283,3 @@ ```ts

The wasm binary won't be fetched or instantiated unless a [read](#readbarcodefromimagefile-and-readbarcodefromimagedata) or [write](#writebarcodetoimagefile) function is firstly called, and will only be instantiated once given the same module overrides. So there'll be a cold start in the first function call (or several calls if they appear in a very short period). If you want to manually trigger the download and instantiation of the wasm binary prior to any read or write functions, you can use `getZXingModule`. This function will also return a `Promise` that resolves to a `ZXingModule`, the wasm `Module` object this wrapper library is built upon.
The wasm binary won't be fetched or instantiated unless a [read](#readbarcodefromimagefile-and-readbarcodefromimagedata) or [write](#writebarcodetoimagefile) function is firstly called, and will only be instantiated once given the same module overrides. So there'll be a cold start in the first function call (or several calls if they appear in a very short period). If you want to manually trigger the download and instantiation of the wasm binary prior to any read or write functions, you can use `getZXingModule`. This function will also return a `Promise` that resolves to a `ZXingModule`.

@@ -284,0 +286,0 @@ ```ts

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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