wcwidth-compat 1.0.3-dev

wcwidth written in pure D.


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

wcwidth-compat

Cross-Compiling

This library is a port of wcwidth to the D language.

Usage

D

It is very simple to use.

import wcwidth_compat;

assert(wcwidth(cast(uint)('A') == 2);

wasm

The generated WASM is not optimized, so you need to optimize it with a tool such as Binaryen.

wasm-opt -O -o wcwidth-compat.wasm wcwidth-compat.wasm

When run in Node.js, the code is as follows.

const fs = require('fs');

let bytes = new Uint8Array(fs.readFileSync('./wcwidth-compat.wasm'));
let instance = new WebAssembly.Instance(new WebAssembly.Module(bytes), {});

let input = 'A';
console.log(instance.exports.wcwidth(input.codePointAt(0)));
Authors:
  • dokutoku
Dependencies:
none
Versions:
1.0.3-dev 2021-Mar-29
1.0.2-dev 2021-Mar-08
1.0.1-dev 2021-Mar-07
1.0.0-dev 2021-Mar-07
~master 2021-Apr-04
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 0 downloads total

Score:
0.4
Short URL:
wcwidth-compat.dub.pm