@biscuit-auth/biscuit-wasm

中文文档
0.6.0发布于 2025/09/27Apache-2.0TypeScriptES Module零依赖近 30 天下载 7.9万

WebAssembly wrapper for Biscuit authorization tokens

原始使用文档
文档目录4 节
  1. Usage
  2. Node
  3. In browser
  4. License

Biscuit-wasm

This repo is part of the eclipse biscuit project.

This library wraps the Rust implementation of Eclipse Biscuit tokens in WebAssembly, for usage in NodeJS and browsers.

It provides both EcmaScript and CommonJS modules, along with TypeScript type definitions.

Usage

Add this dependency to your package.json:

{
  "dependencies": {
    "@biscuit-auth/biscuit-wasm": "0.6.0-beta.1"
  }
}

Usage examples are available here.

Node

see the example code in examples/node

The node executable must be started with the --experimental-wasm-modules flag.

In browser

see the example code in examples/frontend

Importing a WebAssembly library with a bundler can take a bit of configuration. We have a working example with Webpack, and would welcome example configuration for other bundlers:

const path = require("path");

module.exports = {
  entry: "./index.js",
  output: {
    filename: "index.js",
    path: path.resolve(__dirname, "dist"),
  },
  experiments: {
    asyncWebAssembly: true,
  },
};

License

Licensed under the Apache 2.0 License.

Copyright 2021 Geoffroy Couprie

版本与发布记录

@biscuit-auth/biscuit-wasm 共发布 18 个版本,首次发布于 2021/12/23;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.6.0latest2025/09/271.1 年前
0.6.0-beta.2next2025/09/261.1 年前
0.6.0-beta.12025/03/111.7 年前
0.5.02024/07/312 年前
0.4.12024/07/012 年前
0.4.02023/04/273 年前

关于 @biscuit-auth/biscuit-wasm 的常见问题

@biscuit-auth/biscuit-wasm 是什么?

WebAssembly wrapper for Biscuit authorization tokens

如何安装 @biscuit-auth/biscuit-wasm?

在项目目录运行 npm install @biscuit-auth/biscuit-wasm,或使用 pnpm add / yarn add / bun add。

@biscuit-auth/biscuit-wasm 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@biscuit-auth/biscuit-wasm 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@biscuit-auth/biscuit-wasm 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@biscuit-auth/biscuit-wasm 可以商用吗?

@biscuit-auth/biscuit-wasm 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@biscuit-auth/biscuit-wasm 的下载量有多少?

根据 npm 官方下载统计,@biscuit-auth/biscuit-wasm 在 2026/10/08 – 2026/11/06 这 30 天内被下载 78,875 次,日均约 2,629 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@biscuit-auth/biscuit-wasm 还在维护吗?

最新版本 0.6.0 发布于 2025/09/27(1.1 年前);至今共发布 18 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/12/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。