Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Cross-platform Node.js binding for controlling GPIOs on Silicon Labs CP2102N
Cross-platform Node.js binding for controlling GPIOs on Silicon Labs CP2102N.
npm install --save cp2102n
This package shiped with prebuilt Node.js native addon for following platforms:
linux | darwin | win32 | |
---|---|---|---|
x64 | ✓ | ✓ | TODO |
arm | ✓ | n/a | n/a |
arm64 | ✓ | TODO |
npm install --save cp2102n --build-from-source
Additional build dependencies are required on different platforms:
sudo apt install -y build-essential cmake ninja-build pkg-config libusb-1.0-0-dev
brew install cmake ninja pkg-config libusb
sudo apt install -y libusb-1.0-0
brew install libusb
import { openInterface } from 'cp2102n';
try {
const device = await openInterface('/dev/cu.usbserial-1140');
await device.set({ [0]: true, [6]: true });
device.close();
} catch (e) {
console.error(e);
}
openInterface(path)
path
- string
Promise<CP2102N>
Open an interface with path
(i.e. /dev/cu.usbserialXXX
on macOS, /dev/ttyUSBX
on Linux). Throws if path
is not a valid CP2102N device.
CP2102N
cp2102n.set(state)
state
- { [pin: number]: boolean }
Promise<{ [pin: number]: boolean }>
Set state of pins to high (true
) or low (false
). Returns the latest state.
cp2102n.get()
Promise<{ [pin: number]: boolean }>
Get state of all PINs.
cp2102n.setRaw(state, mask)
state
- number
mask
- number
Promise<number>
Set state of masked pins in bits. Returns the latest state bits.
cp2102n.getRaw()
Promise<number>
Get state of pins in bits.
cp2102n.close()
Close interface.
FAQs
Cross-platform Node.js binding for controlling GPIOs on Silicon Labs CP2102N
The npm package cp2102n receives a total of 15 weekly downloads. As such, cp2102n popularity was classified as not popular.
We found that cp2102n demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.