@slashid/fnmatch
v0.2.0
Published
Wasm wrapper for @slashid/fnmatch go library
Maintainers
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/fnmatchYou must load tinygo wasm runtime before this library.
You have two options for getting the runtime:
- Get it from your
tinygoinstall:cp $(tinygo env TINYGOROOT)/targets/wasm_exec.js .
- We ship a compatible
wasm_exec.jswith 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) // falseContributing
Build
This library is built using tinygo, Rollup and @rollup/plugin-wasm.
npm run buildPublish dry-run
For you convenience there is a yalc publishing helper.
npm run publish:yalc