onigasm
WebAssembly port of Oniguruma regex library
Last updated 7 years ago by sweetslush .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install onigasm 
SYNC missed versions from official npm registry.

Onigasm (OnigurumaASM)

WebAssembly port of Oniguruma regex library.

Usage/API/Behaviour 1:1 with node-oniguruma port, tests are literally imported from node-oniguruma repository for maximum compliance.

Of course, unlike node-oniguruma, this library can't hook into roots of V8 and is therefore 2 times* slower than the former.

Instructions for porting your app to web

Install

npm i onigasm

Light it up

WASM must be loaded before you use any other feature like OnigRegExp or OnigScanner

// index.js (entry point)

import { loadWASM } from 'onigasm'
import App from './App'

(async () => {
    await loadWASM('path/to/onigasm.wasm') // You can also pass ArrayBuffer of onigasm.wasm file
    App.start()
})()

// `onigasm.wasm` file will be available at `onigasm/lib/onigasm.wasm` in `node_modules` of your project directory

Once loaded onigasm is a drop-in replacement for oniguruma

- import { OnigRegExp } from 'oniguruma'
+ import { OnigRegExp } from 'onigasm'

That's it!

* Tested under laboratory conditions using benchmark.js


License

onigasm is licensed under MIT License. See LICENSE in the root of this project for more info.

Contributors/Maintainers

Current Tags

  • 2.2.5                                ...           latest (4 years ago)

14 Versions

  • 2.2.5                                ...           4 years ago
  • 2.2.4                                ...           5 years ago
  • 2.2.3                                ...           5 years ago
  • 2.2.2                                ...           6 years ago
  • 2.2.1                                ...           6 years ago
  • 2.2.0                                ...           6 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           7 years ago
  • 1.3.1                                ...           7 years ago
  • 1.3.0                                ...           7 years ago
  • 1.2.0                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 10
Last Month 0
Dependencies (1)
Dev Dependencies (5)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |