# normalize-space-x

> Trims and replaces sequences of whitespace characters by a single space.

Latest version **4.1.2** (published 2019-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install normalize-space-x
pnpm add normalize-space-x
yarn add normalize-space-x
bun add normalize-space-x
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.2 |
| Published | 2019-08-28 |
| First published | 2017-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8.11.4 |
| Dependencies | 3 |
| Unpacked size | 151.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Graham Fairweather |
| Maintainers | xotic750 |
| Keywords | string, normalize-space, module, javascript, nodejs, browser |

## Links

- npm: https://www.npmjs.com/package/normalize-space-x
- Repository: https://github.com/Xotic750/normalize-space-x
- Issues: https://github.com/Xotic750/normalize-space-x/issues
- npm.io page: https://npm.io/package/normalize-space-x

## Dependencies (3)

- [trim-x](https://npm.io/package/trim-x.md) ^4.1.2
- [white-space-x](https://npm.io/package/white-space-x.md) ^4.1.1
- [simple-methodize-x](https://npm.io/package/simple-methodize-x.md) ^1.0.4

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 4.1.2 (latest) — 2019-08-28
- 4.1.1 — 2019-08-20
- 4.1.0 — 2019-08-14
- 4.0.38 — 2019-07-31
- 4.0.37 — 2019-07-27
- 4.0.36 — 2019-07-27
- 4.0.35 — 2019-07-26
- 4.0.34 — 2019-07-25
- 4.0.33 — 2019-07-24
- 4.0.32 — 2019-07-24
- 4.0.31 — 2019-07-23
- 4.0.29 — 2019-07-22
- 4.0.28 — 2019-07-21
- 4.0.27 — 2019-07-19
- 4.0.26 — 2019-07-18
- … 27 more at https://npm.io/package/normalize-space-x/versions

## README

<a
  href="https://travis-ci.org/Xotic750/normalize-space-x"
  title="Travis status">
<img
  src="https://travis-ci.org/Xotic750/normalize-space-x.svg?branch=master"
  alt="Travis status" height="18">
</a>
<a
  href="https://david-dm.org/Xotic750/normalize-space-x"
  title="Dependency status">
<img src="https://david-dm.org/Xotic750/normalize-space-x/status.svg"
  alt="Dependency status" height="18"/>
</a>
<a
  href="https://david-dm.org/Xotic750/normalize-space-x?type=dev"
  title="devDependency status">
<img src="https://david-dm.org/Xotic750/normalize-space-x/dev-status.svg"
  alt="devDependency status" height="18"/>
</a>
<a
  href="https://badge.fury.io/js/normalize-space-x"
  title="npm version">
<img src="https://badge.fury.io/js/normalize-space-x.svg"
  alt="npm version" height="18">
</a>
<a
  href="https://www.jsdelivr.com/package/npm/normalize-space-x"
  title="jsDelivr hits">
<img src="https://data.jsdelivr.com/v1/package/npm/normalize-space-x/badge?style=rounded"
  alt="jsDelivr hits" height="18">
</a>
<a
  href="https://bettercodehub.com/results/Xotic750/normalize-space-x"
  title="bettercodehub score">
<img src="https://bettercodehub.com/edge/badge/Xotic750/normalize-space-x?branch=master"
  alt="bettercodehub score" height="18">
</a>
<a
  href="https://coveralls.io/github/Xotic750/normalize-space-x?branch=master"
  title="Coverage Status">
<img src="https://coveralls.io/repos/github/Xotic750/normalize-space-x/badge.svg?branch=master"
  alt="Coverage Status" height="18">
</a>

<a
  href="https://coveralls.io/github/Xotic750/normalize-space-x?branch=master"
  title="Coverage Status">
<img src="https://coveralls.io/repos/github/Xotic750/normalize-space-x/badge.svg?branch=master"
  alt="Coverage Status" height="18">
</a>

<a name="module_normalize-space-x"></a>

## normalize-space-x

Trims and replaces sequences of whitespace characters by a single space.

### `module.exports(string)` ⇒ <code>string</code> ⏏

<a name="module_normalize-space-x"></a>

### `normalize-space-x` ⇒ <code>string</code>

This method strips leading and trailing white-space from a string,
replaces sequences of whitespace characters by a single space,
and returns the resulting string. (ES2019)

**Kind**: static property of [<code>normalize-space-x</code>](#module_normalize-space-x)  
**Returns**: <code>string</code> - The normalized string.  
**Throws**:

- <code>TypeError</code> If string is null or undefined or not coercible.

| Param  | Type                | Description                  |
| ------ | ------------------- | ---------------------------- |
| string | <code>string</code> | The string to be normalized. |

**Example**

```js
import normalizeSpace from 'normalize-space-x';

console.log(normalizeSpace(' \t\na \t\nb \t\n') === 'a b'); // true
```

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