npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

native-liblouis

v0.2.1

Published

Native Module for running a native version of the Liblouis braille translator

Readme

native-liblouis

NPM Version License

Use the Liblouis braille translation engine in React Native + Expo (iOS, Android) and on the web (WASM). Out of the box, the package bundles:

  • UEB Uncontracted (en-ueb-g1.ctb)
  • UEB Contracted (en-ueb-g2.ctb)
  • Their required include dependencies

You can add more tables and ship them with your app.


Table of Contents


Live Demo

Website: https://hen1227.github.io/native-liblouis/

Install

# Using npm
npm install native-liblouis

# Or using yarn
yarn add native-liblouis

Want to use a locally modified build (e.g., with extra/other tables)? See Using your locally built package.

API

LibLouis provides a lot of functionality. However, native-liblouis only exposes the following functions:

lou_translateString(input: string, table: string): string

Translates a string using the specified LibLouis table. Returns the translated string in Braille ASCII format.

import { lou_translateString } from 'native-liblouis';

const table = 'unicode.dis,en-ueb-g2.ctb'; // includes ASCII mapping
const result = lou_translateString(
  'Hello world',
  table
);

console.log(result); // ⠓⠑⠇⠇⠕ ⠺⠕⠗⠇⠙

lou_translateBackString(input: string, table: string): string

Translates a Braille ASCII string back to text using the specified LibLouis table. Returns the translated string in text format.

const table = 'unicode.dis,en-ueb-g2.ctb';
const braille = '⠓⠑⠇⠇⠕ ⠺⠕⠗⠇⠙';

const result = lou_translateBackString(
  braille,
  table
);

console.log(result); // Hello world

lou_initialize(): Promise<void> (Web only)

Initializes the LibLouis library and loads the bundled tables. Must be called before using any translation functions on web. On iOS and Android, initialization happens automatically.

if (Platform.OS === 'web') {
  await lou_initialize();
}

lou_isInitialized(): boolean

Returns whether the LibLouis library has been initialized.

if (!lou_isInitialized()) {
  console.warn('LibLouis not ready yet');
}

See the example app for a full usage example.


Managing Tables

You can ship extra Liblouis tables with your app. This repo includes a few npm-based tools and scripts.

Add/Remove with the CLI

# Add tables (will also pull required dependencies via `include` directives)
npm run tables:add en-ueb-math.ctb
npm run tables:add da-dk-g2.ctb vi-vn-g2.ctb

# Remove a table
npm run tables:remove en-ueb-math.ctb

# List bundled tables
npm run tables:list

# Clear them all
npm run tables:clear

The CLI automatically resolves dependencies and downloads tables from the LibLouis repository.

You can also drop .ctb/.utb/.dis/.cti files manually into bundled_tables/, but the CLI is safer and resolves dependencies.

Sync native modules

  • Only tables changed (native + web by default):

    npm run tables:sync

    This updates the list of tables bundled in the native modules. Because the web build embeds tables in the WASM bundle, this step also rebuilds the WebAssembly module with the new tables.

  • If you don’t need web updated, you can skip WASM work with:

    npm run tables:sync:noweb
  • Rebuild native modules (iOS/Android C/C++ libs):

    npm run rebuild-native

After syncing or rebuilding, pack and reinstall the package in your app (see next section).



Using your locally built package

Pack and install in your app

When you’ve updated tables or rebuilt natives:

# In native-liblouis repo root
npm pack
# => produces something like native-liblouis-0.2.0.tgz

Then, in your app:

# From your app’s root
npm i ../path/to/native-liblouis/native-liblouis-0.2.0.tgz
# or with yarn/pnpm if you prefer

You can also point package.json to the tarball:

{
  "dependencies": {
    "native-liblouis": "file:../native-liblouis/native-liblouis-0.2.0.tgz"
  }
}

Monorepo/dev alt

For quick iteration you can use a file: folder dep:

{
  "dependencies": {
    "native-liblouis": "file:../native-liblouis"
  }
}

…but for reproducible builds and CI, prefer the tarball produced by npm pack.


TODO

  • [ ] Allow runtime table loading from custom table path
  • [ ] Add more tests
  • [ ] Add more documentation

License

This project is licensed under the LGPL-2.1 or later license. See the LICENSE file for details. Liblouis itself is licensed under the LGPL-2.1 or later license.

Contributing

Any contributions are welcome! If you find a bug, have a feature request, or want to improve the documentation, please open an issue or submit a pull request. Here are some people who have contributed to native-liblouis so far:

And a special thanks to Liblouis for providing the braille translation engine that powers this package.