@acakar/tensionscript

中文文档
0.10.0发布于 2026/10/27Apache-2.0TypeScriptESM + CJS近 30 天下载 2432

TensionScript: a TypeScript-shaped language for WebAssembly, forked from AssemblyScript for the Tension engine.

此软件包已被标记为弃用

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

原始使用文档
文档目录5 节
  1. Install
  2. Usage
  3. Status
  4. Links
  5. Attribution and license

TensionScript

A TypeScript-shaped language for WebAssembly — the compiler Tension's guests are written in.

TensionScript compiles TypeScript syntax to WebAssembly using Binaryen. It is maintained for the Tension engine as a fork of AssemblyScript. The command and the package are its own: it does not collide with asc (AssemblyScript's compiler) or tsc (TypeScript's), so a project that installs both compilers always resolves the one it named.

Install

npm install @acakar/tensionscript

Usage

The command is tensionscript. From an npm script, tensionscript … resolves to the installed package's binary; from a shell, npx tensionscript … does:

npx tensionscript assembly/index.ts -o build/index.wasm --runtime incremental --target release

The compiler is also a library, under the package's asc subpath:

import tensionscript from "@acakar/tensionscript/asc";

Status

Forked from AssemblyScript. What this fork changes:

  • this in arrow functions — landed. An arrow resolves this to the receiver of the nearest enclosing non-arrow function, which is TypeScript's rule, instead of to the enclosing function element. The receiver travels with the function value in its environment and is delivered at each indirect call.
  • async/await — pending.
  • closures — pending.

Everything else tracks the upstream project it was forked from; the divergence is deliberate and each change lands with tests.

Attribution and license

Based on AssemblyScript, Apache-2.0 licensed. Original project at https://github.com/AssemblyScript/assemblyscript.

The NOTICE file retains the original project's attribution, and the license is the Apache License 2.0 (LICENSE).

版本与发布记录

@acakar/tensionscript 共发布 18 个版本,首次发布于 2026/10/18;过去 12 个月发布了 18 个版本。

版本发布日期距今
0.10.0latest2026/10/2712 天前
0.9.02026/10/2315 天前
0.8.12026/10/2316 天前
0.8.02026/10/2316 天前
0.7.12026/10/2117 天前
0.7.02026/10/2117 天前

关于 @acakar/tensionscript 的常见问题

@acakar/tensionscript 是什么?

TensionScript: a TypeScript-shaped language for WebAssembly, forked from AssemblyScript for the Tension engine.注意:该包已被作者标记为弃用——Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

如何安装 @acakar/tensionscript?

在项目目录运行 npm install @acakar/tensionscript,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 tensionscript,可以用 npx tensionscript 直接运行。

@acakar/tensionscript 支持 TypeScript 吗?

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

@acakar/tensionscript 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@acakar/tensionscript 需要什么版本的 Node.js?

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

@acakar/tensionscript 可以商用吗?

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

@acakar/tensionscript 的下载量有多少?

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

@acakar/tensionscript 还在维护吗?

最新版本 0.10.0 发布于 2026/10/27(12 天前);至今共发布 18 个版本,其中过去 12 个月发布了 18 个;首次发布于 2026/10/18。作者已将其标记为弃用,新项目建议寻找替代方案。