# zero-width

> remove zero-width and some other util about space

Latest version **1.0.35** (published 2026-09-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install zero-width
pnpm add zero-width
yarn add zero-width
bun add zero-width
```

## Health

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

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.35 |
| Published | 2026-09-11 |
| First published | 2019-08-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 36.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | bluelovers |
| Maintainers | bluelovers |
| Keywords | check, es2018, esnext, flag, flags, helper, is, pattern, re, regex, regexp, regular expression, space, support, supported, unicode, util, valid, variation-selectors, zero-width |

## Links

- npm: https://www.npmjs.com/package/zero-width
- Repository: https://github.com/bluelovers/ws-string
- Homepage: https://github.com/bluelovers/ws-string/tree/master/packages/zero-width#readme
- Issues: https://github.com/bluelovers/ws-string/issues
- npm.io page: https://npm.io/package/zero-width

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.8.1
- [regexp-helper-core](https://npm.io/package/regexp-helper-core.md) ^2.0.13

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.35 (latest) — 2026-09-11
- 1.0.34 — 2026-09-11
- 1.0.33 — 2026-09-11
- 1.0.29 — 2024-02-03
- 1.0.28 — 2024-01-29
- 1.0.27 — 2023-09-08
- 1.0.26 — 2023-04-12
- 1.0.25 — 2022-11-01
- 1.0.24 — 2022-10-15
- 1.0.23 — 2022-09-16
- 1.0.22 — 2022-08-27
- 1.0.19 — 2022-08-26
- 1.0.18 — 2022-08-26
- 1.0.17 — 2022-01-17
- 1.0.16 — 2021-07-05
- … 9 more at https://npm.io/package/zero-width/versions

## README

# zero-width

> remove zero-width and some other util about space

## 安裝 (Installation)

```bash
# 使用 yarn / Using yarn
yarn add zero-width

# 使用 yarn-tool / Using yarn-tool
yarn-tool add zero-width
# yt 是 yarn-tool 的別名 / yt is an alias for yarn-tool
yt add zero-width

# 使用 pnpm / Using pnpm
pnpm add zero-width

# 使用 npm / Using npm
npm install zero-width
```

```ts
let os = [
	'\udb40\udd00\n\r\b\t\v\u00a0 　\u0009',
	ENUM_ZERO_WIDTH.SPACE,
	ENUM_ZERO_WIDTH.NO_BREAK_SPACE,
	ENUM_ZERO_WIDTH.RIGHT_TO_LEFT_MARK,
	ENUM_ZERO_WIDTH.LEFT_TO_RIGHT_MARK,
].join('');

let ns = removeZeroWidth(os);

console.dir({
	os,
	ns,
	os_len: os.length,
	ns_len: ns.length,
});
```

=>

```json5
{
  os: '󠄀\n\r\b\t\u000b  　\t',
  ns: '\n\r\b\t\u000b  　\t',
  os_len: 15,
  ns_len: 9
}
```

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