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
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)));
Related project
- 1.0.3-dev released 3 years ago
- dokutoku/wcwidth-compat
- gitlab.com/dokutoku/wcwidth-compat
- MIT
- Copyright © 2021, dokutoku
- Authors:
- 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 2022-Jul-26 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
11 downloads total
-
- Score:
- 0.4
- Short URL:
- wcwidth-compat.dub.pm