Home

Awesome

Fcitx5 JS

Fcitx5 input method framework ported to JavaScript with WebAssembly.

The project provides an npm package fcitx5-js-*.tgz, which powers derivative apps for end user.

DerivativeNote
Fcitx5 OnlinePreview

Build

Fcitx5 JS can be built on Linux, macOS and WSL.

Install node

You may use nvm to install node.

Install pnpm and dev dependencies

npm i -g pnpm
pnpm i
pnpm --prefix=fcitx5-webview i
./scripts/install-deps.sh

Install emsdk

https://emscripten.org/docs/getting_started/downloads.html

Build with CMake

emcmake cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
EMCC_FORCE_STDLIBS=libc++ FCITX_DISTRIBUTION=fcitx5-js cmake --build build

You can also use Ctrl+Shift+B (or Cmd+Shift+B on macOS) in VSCode to execute a task.

Preview

npx serve -l 9000 -S preview

See interface FCITX in Fcitx5.d.ts for a list of JS APIs. They are methods of window.fcitx object.

Pack

npm pack