Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
db09a62
Replace TravisCI with working Github-Actions CI/CD (#107)
sebi2k1 Nov 5, 2022
26bdb38
Use JS-DevTools to publish only on change
sebi2k1 Nov 6, 2022
2215470
Dummy change
sebi2k1 Nov 6, 2022
e547ff2
Fixed type
sebi2k1 Nov 6, 2022
4b0ffa8
Test
sebi2k1 Nov 6, 2022
702e632
Disable dry-run
sebi2k1 Nov 6, 2022
846fb02
Refer to production policy to require additional approval
sebi2k1 Nov 6, 2022
64dee9c
Fixed build-badge
sebi2k1 Nov 6, 2022
964e800
Port to Typescript (#105)
jbcpollak Nov 8, 2022
8106f69
Fixed some docs to reflect new TS
sebi2k1 Nov 8, 2022
b3f0f52
Refreshed docs
sebi2k1 Nov 8, 2022
9b320f3
dry-run for now
sebi2k1 Nov 8, 2022
9b25ddc
compile the TS before publishing (#108)
jbcpollak Nov 9, 2022
7bfaf80
include binding.gyp, explicitly build native (#109)
jbcpollak Nov 9, 2022
0ec6df7
Fixed prebuild
sebi2k1 Nov 9, 2022
0d4c8a3
Finalized
sebi2k1 Nov 9, 2022
d309645
Update package.json
sebi2k1 Nov 15, 2022
a731f5e
Added possibility to set BRS flag in SendFD (#110)
wdim0 Nov 19, 2022
5b5185a
New release with CAN FD BRS support
sebi2k1 Nov 19, 2022
525562b
Bump json5 from 2.2.1 to 2.2.3 (#111)
dependabot[bot] Jan 9, 2023
9ce60e4
Update package.json
sebi2k1 Jan 14, 2023
dae7416
Bump http-cache-semantics from 4.1.0 to 4.1.1 (#115)
dependabot[bot] Feb 5, 2023
414664c
Fix #116 by referencing ambient declarations (#117)
jbcpollak Feb 13, 2023
f56059e
Update package.json
sebi2k1 Feb 13, 2023
c17c4dd
Bump xml2js from 0.4.23 to 0.5.0 (#118)
dependabot[bot] May 9, 2023
f7a1b72
Bump semver from 6.3.0 to 6.3.1 (#119)
dependabot[bot] Jul 16, 2023
f8dd500
Bump word-wrap from 1.2.3 to 1.2.4 (#120)
dependabot[bot] Jul 27, 2023
d83740a
Add TypeScript examples (#123)
milesstoetzner Sep 23, 2023
5189bab
Update cicd.yml
sebi2k1 Sep 23, 2023
f8f6ddb
Update cicd.yml
sebi2k1 Sep 23, 2023
1ec4e97
Update cicd.yml
sebi2k1 Sep 23, 2023
7e26fbd
Update cicd.yml
sebi2k1 Sep 24, 2023
cfb1421
Update README.md
sebi2k1 Sep 24, 2023
c9bb035
Update npmpublish.yml
sebi2k1 Sep 24, 2023
1eae594
Update README.md (#125)
sebi2k1 Sep 24, 2023
db7fb7e
Switched to jsdoc
sebi2k1 Sep 24, 2023
4edb14e
Merge branch 'master' of https://github.com/sebi2k1/node-can
sebi2k1 Sep 24, 2023
4831333
Update package.json
sebi2k1 Sep 24, 2023
ad586ce
Bump @babel/traverse from 7.20.1 to 7.23.2 (#129)
dependabot[bot] Oct 20, 2023
182d2a1
Updated package-lock and fixed deprecated warn
sebi2k1 Feb 17, 2024
c042d62
Use NAN_MODULE_WORKER_INIT instead of NODE_MODULE
sebi2k1 Feb 17, 2024
2984cd8
Upgrade NAN to 2.21.0
sebi2k1 Oct 12, 2024
a99599f
Drop 19.x development version
sebi2k1 Oct 12, 2024
69cf5db
Bump braces from 3.0.2 to 3.0.3 (#135)
dependabot[bot] Oct 12, 2024
fffbf35
Bump tar from 6.1.12 to 6.2.1 (#134)
dependabot[bot] Oct 12, 2024
3714a32
Bump serialize-javascript and mocha (#137)
dependabot[bot] Apr 17, 2025
a58946e
Add onMessageUpdate listener (#138)
Kheirlb Apr 17, 2025
a5950fa
Add err boolean type to can.d.ts Message (#139)
Kheirlb Apr 18, 2025
d884770
Update package.json
sebi2k1 Apr 18, 2025
b0fd860
Upgade NAN (#143)
sebi2k1 Aug 28, 2025
b24bd15
Bump brace-expansion from 1.1.11 to 1.1.12 (#145)
dependabot[bot] Aug 28, 2025
47f2f18
Update package.json
sebi2k1 Sep 1, 2025
d51e617
Bump tar and node-gyp (#150)
dependabot[bot] May 23, 2026
a7a99a1
Bump js-yaml from 3.14.1 to 3.14.2 (#146)
dependabot[bot] May 23, 2026
9e6929c
Migrate native addon from nan to node-addon-api (N-API) (#152)
sebi2k1 May 23, 2026
bebb9b1
Bump minimatch from 3.1.2 to 3.1.5 (#159)
dependabot[bot] May 25, 2026
27a2d44
Bump picomatch from 2.3.1 to 2.3.2 (#158)
dependabot[bot] May 25, 2026
7d3af9b
Bump flatted from 3.2.7 to 3.4.2 (#157)
dependabot[bot] May 25, 2026
d9db3fa
Bump brace-expansion from 1.1.12 to 1.1.14 (#156)
dependabot[bot] May 25, 2026
59142ff
fix(can.cc): use napi_make_callback to drain microtasks between onMes…
sebi2k1 May 27, 2026
35ee9c3
chore: upgrade all dependencies to latest, bump to v4.2.0 (#162)
sebi2k1 May 28, 2026
d404cf7
Standard MD files
sebi2k1 May 31, 2026
2201734
chore: open source hygiene improvements
sebi2k1 May 31, 2026
2f162cb
Configure Dependabot for npm updates
sebi2k1 May 31, 2026
1ec4d44
fix: resolve dependabot vulnerabilities via npm overrides
sebi2k1 May 31, 2026
27c5397
Potential fix for code scanning alert no. 3: Workflow does not contai…
sebi2k1 May 31, 2026
a78fb6c
Bump eslint from 10.4.0 to 10.4.1
dependabot[bot] May 31, 2026
ea4b8b3
Bump @types/node from 22.19.19 to 25.9.1
dependabot[bot] May 31, 2026
8a6861e
Potential fix for code scanning alert no. 1: Workflow does not contai…
sebi2k1 May 31, 2026
5ec074c
4.2.1
sebi2k1 May 31, 2026
2cf6e0a
Add float32 (single) and float64 (double) signal type support
sebi2k1 May 31, 2026
70c0756
Fix review findings: effectiveBitLength, type safety, and test coverage
sebi2k1 May 31, 2026
4ac7448
Improve readability: strong types, named constants, no magic numbers
sebi2k1 May 31, 2026
f2a5911
Apply C++20 best practices to signals.cc
sebi2k1 May 31, 2026
5f75982
Expand code style guidelines in CONTRIBUTING.md
sebi2k1 May 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/docker-existing-dockerfile
{
"name": "Existing Dockerfile",

// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile"

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 2
charset = utf-8

# 4 space indentation
[*.py]
indent_style = space
indent_size = 2

# Matches the exact files either package.json or any .yml
[{*.json,*.yml,*.yaml}]
indent_style = space
indent_size = 2

[*.{js,ts,jsx,tsx,html}]
indent_style = tab
indent_size = 2

67 changes: 67 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Bug report
description: Something isn't working as expected
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report a bug. Please fill in as much detail as you can.

- type: input
id: version
attributes:
label: socketcan version
description: Output of `npm list socketcan`
validations:
required: true

- type: input
id: node
attributes:
label: Node.js version
description: Output of `node --version`
validations:
required: true

- type: input
id: os
attributes:
label: Linux distribution and kernel
description: e.g. Ubuntu 24.04, kernel 6.8.0
validations:
required: true

- type: dropdown
id: interface
attributes:
label: CAN interface type
options:
- Virtual (vcan)
- Physical hardware
- Both
validations:
required: true

- type: textarea
id: description
attributes:
label: What happened?
description: A clear description of the bug.
validations:
required: true

- type: textarea
id: expected
attributes:
label: What did you expect to happen?
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: Minimal reproduction
description: A short script or test case that reproduces the issue.
render: javascript
validations:
required: false
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Feature request
description: Suggest a new feature or improvement
labels: [enhancement]
body:
- type: textarea
id: problem
attributes:
label: What problem does this solve?
description: Describe the use case or limitation you're running into.
validations:
required: true

- type: textarea
id: proposal
attributes:
label: Proposed solution
description: What would you like to see added or changed?
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Any workarounds or alternative approaches you've thought about.
validations:
required: false
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Summary

<!-- What does this PR change and why? -->

## Type of change

- [ ] Bug fix
- [ ] New feature
- [ ] Refactor / cleanup
- [ ] Documentation
- [ ] CI / tooling

## Checklist

- [ ] `npm run build:all` passes (or validated via `docker build -f Dockerfile.build-test .` on macOS)
- [ ] `npm run lint` passes
- [ ] Tests added or updated for changed behaviour
- [ ] `npm test` passes (requires `sh prepare_test_env.sh` first)
- [ ] CHANGELOG.md updated if this is a user-facing change
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
50 changes: 50 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Full build and test

on: [ push, pull_request ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [ 22.x, 24.x ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package-lock.json

- name: Prepare Ubuntu
run: |
sudo apt-get install -y can-utils
sudo apt-get install -y libnode-dev
sudo apt-get install linux-modules-extra-$(uname -r)

- name: Prepare deps
run: |
npm ci

- name: Compile
run: |
npm run configure
npm run build:all

- name: Lint
run: |
npm run lint

- name: Perform tests
run: |
sh prepare_test_env.sh
npm run test
55 changes: 39 additions & 16 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,47 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish SocketCAN
name: Publish on NPM

on:
push:
branches:
- master
paths:
- 'package.json'
release:
types: [published]

permissions:
contents: read

jobs:
build:
publish:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm publish
node-version: 22
registry-url: 'https://registry.npmjs.org'

- name: Prepare Ubuntu
run: |
sudo apt-get install -y can-utils
sudo apt-get install -y libnode-dev
sudo apt-get install linux-modules-extra-$(uname -r)

- name: Install dependencies
run: npm ci

- name: Build
run: |
npm run configure
npm run build:all

- name: Lint
run: npm run lint

- name: Test
run: |
sh prepare_test_env.sh
npm test

- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build
dist
node_modules
npm-debug.log
build/
package-lock.json
coverage

npm-debug.log
.nyc_output
2 changes: 1 addition & 1 deletion .mocharc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ module.exports = {
slow: 75,
timeout: 2000,
ui: 'bdd',
'watch-files': ['*.js', 'src/*', 'test/*.js']
'watch-files': ['dist/*.js', 'src/*', 'test/*.js']
};
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"mos.port": ""
}
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

## [4.1.0] - 2026-05-17

### Fixed
- **Regression vs 4.0.7**: `onMessage` callbacks are now invoked via
`napi_make_callback` instead of plain `napi_call_function`. This restores
the behaviour of the old NaN implementation, which called
`node::MakeCallback` (and therefore ran a microtask checkpoint and fired
async hooks after each callback). Without this, adapters that queue work
via Promises or `setImmediate` inside `onMessage` could not keep up with
incoming frames, producing "evaluation overloaded" warnings and "bad frame"
errors (reported against ioBroker.e3oncan).
- Exceptions thrown by `onMessage` or `onStopped` callbacks are now forwarded
to Node.js via `napi_fatal_exception` (matching the old `Nan::FatalException`
behaviour) instead of being silently dropped with the JS exception left
pending, which could corrupt subsequent frame objects.

### Changed
- Migrated native addon from `nan` to `node-addon-api` (N-API). The binary
is now ABI-stable across Node.js major versions: a module compiled for
Node.js 20 loads unchanged on Node.js 22 and 24 without recompilation.
This resolves a common issue where upgrading Node.js silently broke
downstream packages (e.g. ioBroker adapters) until a manual rebuild was
performed. The JavaScript API is unchanged.

### Added
- `Dockerfile.build-test` for verifying compilation on Linux without a
physical CAN interface.

## [4.0.7] - 2024-03-13

### Changed
- Bump brace-expansion from 1.1.11 to 1.1.12.
- Upgrade NAN.

## [4.0.6] - 2022-11-14

### Added
- `err` boolean type to `can.d.ts` Message.
Loading