1 # is-whitespace-character
3 [![Build][build-badge]][build]
4 [![Coverage][coverage-badge]][coverage]
5 [![Downloads][downloads-badge]][downloads]
6 [![Size][size-badge]][size]
8 Check if a character is a whitespace character: `\s`, which equals all Unicode
9 Space Separators (including `[ \t\v\f]`), the BOM (`\uFEFF`), and line
10 terminator (`[\n\r\u2028\u2029]`).
17 npm install is-whitespace-character
23 var whitespace = require('is-whitespace-character')
25 whitespace(' ') // => true
26 whitespace('\n') // => true
27 whitespace('\uFEFF') // => true
28 whitespace('_') // => false
29 whitespace('a') // => false
30 whitespace('💩') // => false
35 ### `whitespaceCharacter(character|code)`
37 Check whether the given character code (`number`), or the character code at the
38 first position (`string`), is a whitespace character.
42 * [`is-alphabetical`](https://github.com/wooorm/is-alphabetical)
43 * [`is-alphanumerical`](https://github.com/wooorm/is-alphanumerical)
44 * [`is-decimal`](https://github.com/wooorm/is-decimal)
45 * [`is-hexadecimal`](https://github.com/wooorm/is-hexadecimal)
46 * [`is-word-character`](https://github.com/wooorm/is-word-character)
50 [MIT][license] © [Titus Wormer][author]
54 [build-badge]: https://img.shields.io/travis/wooorm/is-whitespace-character.svg
56 [build]: https://travis-ci.org/wooorm/is-whitespace-character
58 [coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/is-whitespace-character.svg
60 [coverage]: https://codecov.io/github/wooorm/is-whitespace-character
62 [downloads-badge]: https://img.shields.io/npm/dm/is-whitespace-character.svg
64 [downloads]: https://www.npmjs.com/package/is-whitespace-character
66 [size-badge]: https://img.shields.io/bundlephobia/minzip/is-whitespace-character.svg
68 [size]: https://bundlephobia.com/result?p=is-whitespace-character
70 [npm]: https://docs.npmjs.com/cli/install
74 [author]: https://wooorm.com