@slashid/fnmatch
v0.2.0
Published
Wasm wrapper for @slashid/fnmatch go library
Downloads
1,369
Keywords
Readme
fnmatch
Updated clone of kballards golang fnmatch gist (https://gist.github.com/kballard/272720)
JavaScript interopability
This module has javascript<>go interop via wasm
Usage
npm i @slashid/fnmatch
// or
yarn add @slashid/fnmatch
// or
pnpm add @slashid/fnmatch
You must load tinygo wasm runtime before this library.
You have two options for getting the runtime:
- Get it from your
tinygo
install:cp $(tinygo env TINYGOROOT)/targets/wasm_exec.js .
- We ship a compatible
wasm_exec.js
with this library for your convenience:@slashid/fnmatch/wasm_exec.js
<script src="wasm_exec.js"></script>
<script src="your_code.js">></script>
import { fnmatch } from '@slashid/fnmatch'
fnmatch.Match("*yes.com", "[email protected]", fnmatch.FNM_CASEFOLD) // true
fnmatch.Match("*yes.com", "[email protected]", fnmatch.FNM_CASEFOLD) // false
Contributing
Build
This library is built using tinygo, Rollup and @rollup/plugin-wasm.
npm run build
Publish dry-run
For you convenience there is a yalc
publishing helper.
npm run publish:yalc