
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
socketmobile-capturejs
Advanced tools
Socket Mobile Capture JS NPM package for Socket Mobile barcode scanner and NFC Reader/Writer products
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
This Javascript NPM package can be used to add CaptureJS to your Javascript application.
NOTE: If your application is a react-native application please use react-native-capture package which has some native code to make CaptureJS working in iOS and Android.
Add the CaptureJS in your Node project:
npm i socketmobile-capturejs --save
Using CaptureJS in the code:
import { Capture } from 'socketmobile-capturejs';
import React from 'react';
Devices | < 1.3 | 1.3 |
---|---|---|
SocketCam C820 | ❌ | ❌ |
S720/D720/S820 | ❌ | ✅ |
D600, S550, and all other barcode scanners | ✅ | ✅ |
For use with Next.js, you will likely receive the below error.
This is because XmlHttpRequest
is not available server-side. We are working on more concise solution but for now you can use the below workaround to use captureJs in a Next.js project.
First, you need to install next-transpile-modules
and you need to add the below code in your next.config.js
.
const withTM = require("next-transpile-modules")(["socketmobile-capturejs"]);
module.exports = withTM({
webpack5: false,
//your other exports
});
After that, you will need to install the xhr2 package which will enable you to use XMLHttpRequest server side. Then you will need to add this code into your root file (ex: _app.js).
// hack for "next build"
import xhr2 from "xhr2";
import '../styles/globals.css'
// if SSR is working now, replace XMLHttpRequest with lib
if (typeof globalThis.window?.document?.createElement === 'undefined') {
globalThis.XMLHttpRequest = xhr2;
}
Then in your pages or index.js file you can import socketmobile-capture modules. Note: You cannot import socketmobile-capture modules in the same file that you write the above global check or you will get the same undefined XMLHttpRequest error. For more on this type of error, check out the issue raised here.
The online documentation is available here: https://docs.socketmobile.com/capturejs/en/latest/
FAQs
Socket Mobile Capture JS NPM package for Socket Mobile barcode scanner and NFC Reader/Writer products
The npm package socketmobile-capturejs receives a total of 491 weekly downloads. As such, socketmobile-capturejs popularity was classified as not popular.
We found that socketmobile-capturejs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.