
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
TypeScript VISA (Virtual Instrument Software Architecture) library for instrument communication.
A PyVISA-inspired library for controlling test and measurement instruments from Node.js/TypeScript.
npm install visa-ts
This includes serialport and usb as dependencies for Serial and USB-TMC support.
import { createResourceManager } from 'visa-ts';
// Create resource manager
const rm = createResourceManager();
// List connected USB instruments
const resources = await rm.listResources('USB?*::INSTR');
console.log(resources);
// ['USB0::0x1AB1::0x04CE::DS1ZA123456789::INSTR']
// Open instrument
const result = await rm.openResource('USB0::0x1AB1::0x04CE::DS1ZA123456789::INSTR');
if (!result.ok) {
console.error('Failed to open:', result.error);
return;
}
const instr = result.value;
// Configure
instr.timeout = 5000;
// Query device identity
const idn = await instr.query('*IDN?');
if (idn.ok) {
console.log(idn.value); // 'RIGOL TECHNOLOGIES,DS1054Z,...'
}
// Close
await instr.close();
await rm.close();
| Type | Format | Example |
|---|---|---|
| USB-TMC | USB[board]::vendor::product::serial::INSTR | USB0::0x1AB1::0x04CE::DS1ZA123456789::INSTR |
| Serial | ASRL[port]::INSTR | ASRL/dev/ttyUSB0::INSTR |
| TCP/IP | TCPIP[board]::host::port::SOCKET | TCPIP0::192.168.1.100::5025::SOCKET |
// USB - automatic enumeration
const usbDevices = await rm.listResources('USB?*::INSTR');
// Serial - lists available ports
const serialPorts = await rm.listResources('ASRL?*::INSTR');
// TCP/IP - manual (requires known IP)
const instr = await rm.openResource('TCPIP0::192.168.1.100::5025::SOCKET');
listResources(query?: string) — List available instrumentsopenResource(resourceString, options?) — Open connection to instrumentclose() — Close all connectionsquery(cmd) — Write command and read responsequeryBinaryValues(cmd, datatype?) — Query binary datawrite(cmd) — Write command (no response)read() — Read responseclear() — Clear device buffersclose() — Close connectiontimeout — I/O timeout in millisecondsreadTermination — Read termination characterwriteTermination — Write termination characterTest your instrument control code without physical hardware:
import { createResourceManager, createSimulatedPsu } from 'visa-ts';
// Create resource manager and register a simulated PSU
const rm = createResourceManager();
rm.registerSimulatedDevice('PSU', createSimulatedPsu());
// Use it like real hardware
const result = await rm.openResource('SIM::PSU::INSTR');
if (result.ok) {
const psu = result.value;
await psu.write('VOLT 12.0');
await psu.write('OUTP ON');
const voltage = await psu.query('MEAS:VOLT?');
console.log(voltage.value); // '12.000'
}
Available simulated devices: createSimulatedPsu(), createSimulatedLoad(), createSimulatedDmm()
When multiple simulated devices are connected, circuit simulation makes them interact realistically (e.g., PSU current limiting affects Load measurements).
| PyVISA | visa-ts |
|---|---|
rm = pyvisa.ResourceManager() | rm = createResourceManager() |
rm.list_resources() | await rm.listResources() |
instr = rm.open_resource(...) | result = await rm.openResource(...) |
instr.query('*IDN?') | await instr.query('*IDN?') |
instr.timeout = 5000 | instr.timeout = 5000 |
Key differences:
createResourceManager() not new ResourceManager())Result<T, Error> instead of exceptionsMIT
FAQs
TypeScript VISA library for instrument communication
We found that visa-ts demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.