ace-can
v1.0.4
Published
A python-can like CAN bus library for Node.js (busmust/pcan)
Maintainers
Readme
ace-can
Node.js CAN bus bindings for busmust and Peak PCAN hardware.
Getting started
npm install --ignore-scripts
npm run build:tsThe --ignore-scripts flag avoids compiling the native addon when the vendor
SDK libraries are not available on your machine. Once you configure the hardware
SDKs, you can rebuild the native module with:
npm run build:nativeAPI smoke tests
The repository now includes a small suite of Node.js tests that exercise the TypeScript wrapper around the native addon. The tests inject a mocked native binding so they do not require real hardware.
npm testWhat the tests cover:
- Argument forwarding from the JavaScript
CANBusclass to the native constructor. send()delegation to the native instance.- Listener wiring for
messageandcloseevents. - Static helper
CANBus.isAvailable()and top-levelisAvailable()utility.
Because the tests mock the native layer, they are suitable for CI environments
that lack busmust or PCAN hardware. For end-to-end validation against actual
interfaces, set ACE_CAN_CHANNEL, ACE_CAN_BUSTYPE, and ACE_CAN_BITRATE
environment variables in your own integration scripts and exercise the
real hardware using the same API shown in test/canbus-wrapper.test.cjs.
