# lingotweaker-wasm

> LingoTweaker proofreading engine compiled to WebAssembly (browser and Node)

Latest version **0.1.1** (published 2026-09-23) · LGPL-2.1-or-later license · 0 weekly downloads

## Install

```sh
npm install lingotweaker-wasm
pnpm add lingotweaker-wasm
yarn add lingotweaker-wasm
bun add lingotweaker-wasm
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2026-09-23 |
| First published | 2026-09-21 |
| Weekly downloads | 0 |
| License | LGPL-2.1-or-later |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 18 |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7 |
| Maintainers | johanneswilm |
| Keywords | proofreading, grammar, spellcheck, nlp, language, wasm, webassembly |

## Links

- npm: https://www.npmjs.com/package/lingotweaker-wasm
- Repository: https://github.com/fiduswriter/LingoTweaker
- Homepage: https://fiduswriter.github.io/LingoTweaker/
- Issues: https://github.com/fiduswriter/LingoTweaker/issues
- npm.io page: https://npm.io/package/lingotweaker-wasm

## Dependencies (1)

- [lingotweaker-data](https://npm.io/package/lingotweaker-data.md) 0.1.1

## Recent versions

- 0.1.1 (latest) — 2026-09-23
- 0.0.1 — 2026-09-21

## README

# LingoTweaker (WebAssembly)

WebAssembly bindings for the LingoTweaker proofreading engine (wasm-bindgen),
for browsers and Node.js. The engine runs entirely from an in-memory data pack,
so no file system or native addon is required.

```sh
npm install lingotweaker-wasm@next
```

## Browser

```js
import init, { LtEngine } from "lingotweaker-wasm";
import { fetchPack } from "lingotweaker-wasm/pack";

await init();

const pack = await fetchPack("en"); // release asset for this package version
const engine = new LtEngine(
  "en-US",
  pack,
  JSON.stringify({ today: new Date().toISOString() }),
);
const result = JSON.parse(engine.check_json("I can heard you."));
for (const match of result.matches) {
  console.log(match.rule_id, match.suggestions);
}
```

## Node.js

The Node build is CommonJS (`lingotweaker-wasm/node`); the data helper is ESM,
so import it dynamically from CJS:

```js
const { LtEngine } = require("lingotweaker-wasm/node");

(async () => {
  const { fetchPack } = await import("lingotweaker-wasm/pack");
  const pack = await fetchPack("en");
  const engine = new LtEngine(
    "en-US",
    pack,
    JSON.stringify({ today: new Date().toISOString() }),
  );
  console.log(engine.check_json("I can heard you."));
})();
```

Or, from an ES module: `import { LtEngine } from "lingotweaker-wasm/node"`.

`today` is required in practice: WebAssembly has no clock, so the date is
passed in and pinned for the engine's date filters.

## Data

The package ships **code only** and depends on `lingotweaker-data`, which
carries one gzipped pack per language. In Node.js the data helper resolves that
package locally; in the browser (or without it) it falls back to the per-release
GitHub Release assets:

```js
import { fetchPack, packUrl, manifestUrl } from "lingotweaker-wasm/pack";

await fetchPack("en");                  // local lingotweaker-data in Node, else release assets
await fetchPack("gn", { baseUrl: "https://fiduswriter.github.io/LingoTweaker" });
packUrl("de");                           // build a URL yourself
```

`baseUrl` points at a directory that contains `packs/<lang>.pack.gz` and
`manifest.json`. All languages are attached to every release; `manifest.json`
lists file sizes and sha256 hashes. `lingotweaker-data` is also served from any
npm CDN (`https://cdn.jsdelivr.net/npm/lingotweaker-data/packs/<lang>.pack.gz`),
and you can host the packs yourself.

LingoTweaker is an independent project and includes a port of the legacy
LanguageTool proofreading engine and its rule data. Upstream references and
licenses are kept; see `THIRD_PARTY_NOTICES.md` in the repository.

License: LGPL-2.1-or-later.

---
_Source: https://npm.io/package/lingotweaker-wasm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
