# safe-match

> Prevent match API from the result of null

Latest version **0.0.2** (published 2016-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install safe-match
pnpm add safe-match
yarn add safe-match
bun add safe-match
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2016-03-29 |
| First published | 2016-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dafrok |
| Maintainers | dafrok |
| Keywords | match, safe, null |

## Links

- npm: https://www.npmjs.com/package/safe-match
- Repository: https://github.com/Dafrok/safe-match
- Homepage: https://github.com/Dafrok/safe-match#readme
- Issues: https://github.com/Dafrok/safe-match/issues
- npm.io page: https://npm.io/package/safe-match

## Recent versions

- 0.0.2 (latest) — 2016-03-29
- 0.0.1 — 2016-03-29

## README

# safe-match

## Description
Prevent match API from the result of null.

## Install
```
$ npm i safe-match
```

## API
- match
- init
- reset

## Usage
``` javascript
var safeMatch = require('safe-match').match
safeMatch('foo', /bar/) // => []

var safeMatchInit = require('safe-match').init
var safeMatchReset = require('safe-match').reset
safeMatchInit()
'foo'.safeMatch(/bar/) // => []
safeMatchReset()
'foo'.safeMatch(/bar/) // => null

safeMatchInit({
    name: 'match'
})
'foo'.match(/bar/) // => []
safeMatchReset()
'foo'.match(/bar/) // => null

safeMatchInit({
    noConflict: true
})
'foo'.safeMatch(/bar/, true) // => []
'foo'.safeMatch(/bar/) // => null
safeMatchReset()
'foo'.match(/bar/, true) // => null
```

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