# get-safe-reg

> get safe regular-expression

Latest version **0.7.1** (published 2026-10-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-safe-reg
pnpm add get-safe-reg
yarn add get-safe-reg
bun add get-safe-reg
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.7.1 |
| Published | 2026-10-03 |
| First published | 2018-01-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 33.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Hill |
| Maintainers | hillliu |

## Links

- npm: https://www.npmjs.com/package/get-safe-reg
- Repository: https://github.com/react-atomic/react-atomic-organism
- Homepage: https://github.com/react-atomic/react-atomic-organism/tree/main/packages/lib/get-safe-reg
- Issues: https://github.com/react-atomic/react-atomic-organism/issues
- npm.io page: https://npm.io/package/get-safe-reg

## Recent versions

- 0.7.1 (latest) — 2026-10-03
- 0.7.0 — 2025-07-23
- 0.6.2 — 2025-07-23
- 0.6.1 — 2025-07-22
- 0.6.0 — 2025-07-22
- 0.5.9 — 2023-05-08
- 0.5.8 — 2023-05-08
- 0.5.7 — 2023-05-07
- 0.5.6 — 2023-02-19
- 0.5.5 — 2023-02-12
- 0.5.4 — 2023-02-12
- 0.5.3 — 2023-02-11
- 0.5.2 — 2023-02-11
- 0.5.1 — 2023-02-11
- 0.5.0 — 2023-02-11
- … 8 more at https://npm.io/package/get-safe-reg/versions

## README

# Get safe regular-expression

-   GIT
    -   https://github.com/react-atomic/react-atomic-organism/tree/master/packages/lib/get-safe-reg
-   NPM
    -   https://www.npmjs.com/package/get-safe-reg

## !!Important!!

**Wrose case on compress code with cache currying**

-   Bad (Do not use it in compresss code)

```
const cache={};
export default name => cacheReg(cache)(getRegString)(name);
```

-   Good

```
const cache = cacheReg({})(getRegString)
export default name => cache(name);
```

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