# @slashid/fnmatch

> Wasm wrapper for @slashid/fnmatch go library

Latest version **0.2.0** (published 2024-01-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @slashid/fnmatch
pnpm add @slashid/fnmatch
yarn add @slashid/fnmatch
bun add @slashid/fnmatch
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2024-01-09 |
| First published | 2023-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 221.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jake Whelan |
| Maintainers | jake-slashid, paulo_raca, kasper_mroz, jcmfernandes, pedrobrandao, josephmgardner, kobeljic, roblaszczak, snagg, balenio |

## Links

- npm: https://www.npmjs.com/package/@slashid/fnmatch
- Repository: https://github.com/slashid/fnmatch
- Homepage: https://github.com/slashid/fnmatch#readme
- Issues: https://github.com/slashid/fnmatch/issues
- npm.io page: https://npm.io/package/@slashid/fnmatch

## Recent versions

- 0.2.0 (latest) — 2024-01-09
- 0.2.0-next.0 (next) — 2024-01-09
- 0.1.1 — 2023-09-20

## 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:
1. Get it from your `tinygo` install:
    - `cp $(tinygo env TINYGOROOT)/targets/wasm_exec.js .`
2. We ship a compatible `wasm_exec.js` with this library for your convenience:
    - `@slashid/fnmatch/wasm_exec.js`

```html
<script src="wasm_exec.js"></script>
<script src="your_code.js">></script>
```

```ts
import { fnmatch } from '@slashid/fnmatch'

fnmatch.Match("*yes.com", "hello@yes.com", fnmatch.FNM_CASEFOLD) // true
fnmatch.Match("*yes.com", "hello@no.com", fnmatch.FNM_CASEFOLD) // false
```

### Contributing

#### Build
This library is built using [tinygo](https://tinygo.org/), [Rollup](https://rollupjs.org/) and [@rollup/plugin-wasm](https://www.npmjs.com/package/@rollup/plugin-wasm).
```
npm run build
```

#### Publish dry-run
For you convenience there is a `yalc` publishing helper.
```
npm run publish:yalc
```

---
_Source: https://npm.io/package/@slashid/fnmatch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
