Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ jobs:
mkdir -p artifacts/package
npm pack --ignore-scripts --pack-destination artifacts/package

- name: Verify package excludes native build sources
run: |
set -euo pipefail
if tar -tzf artifacts/package/*.tgz | grep -Eq '^package/(binding\.gyp|libopus/|src/)'; then
echo "Release package must contain only prebuilt native binaries." >&2
exit 1
fi

- name: Verify the packed module in native Alpine arm64
run: |
set -euo pipefail
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ It exposes a small JavaScript API backed by N-API native bindings so you can enc
**Key traits:**

- **ESM-only**: the package uses native ES modules; you must `import` it (no `require()`).
- **Prebuilt binaries**: GitHub Actions publishes binaries for Linux, macOS, Windows (including musl) so install usually finishes without a compiler.
- **Prebuilt binaries**: GitHub Actions publishes binaries for Linux, macOS, Windows, and OpenBSD (including Linux musl), so installation never requires a compiler.
- **Node 24+**: built against current Node headers and includes prebuilds for the active LTS line.
- **Minimal surface**: exposes an `OpusEncoder` class with encode/decode helpers plus passthrough CTL access—ideal for bots, streaming services, or testing harnesses that want full control over buffers.

Prebuilt binaries are provided for the platforms listed below; you do not need a system libopus installed.

If no prebuild is available for your target, npm will fall back to `node-gyp-build`, so you can still compile from source as long as a C/C++ toolchain is present.
This package is prebuild-only. An installation target without a matching prebuild is unsupported.

---

Expand Down Expand Up @@ -301,17 +301,19 @@ try {

## Platform support

> ⚠ **Node.js 20.0.0 or newer is required.**
> ⚠ **Node.js 24.0.0 or newer is required.**

Prebuilt binaries are provided for:

| Operating System | Architectures |
| ---------------- | ------------- |
| Linux | x64, arm64 |
| Linux (glibc) | x64, arm64 |
| Linux (musl) | x64, arm64 |
| macOS | x64, arm64 |
| Windows | x64 |
| OpenBSD | x64 |

If a prebuilt binary is not available for your platform, Node will attempt to build from source during installation; this requires a working C/C++ toolchain and build tools for your OS.
If a prebuilt binary is not available for your platform, the package cannot be used on that platform.

---

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "libopus-node",
"version": "1.2.0",
"version": "1.3.0",
"description": "libopus bindings for Node",
"keywords": [
"binary",
Expand All @@ -17,6 +17,10 @@
"type": "git",
"url": "git+https://github.com/biw/libopus-node.git"
},
"files": [
"dist",
"prebuilds"
],
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -27,7 +31,6 @@
}
},
"scripts": {
"install": "node-gyp-build",
"build-native": "node-gyp-build",
"build-package": "vp pack",
"build": "vp run build-native && vp pack",
Expand Down