ascii-whitespace

1.0.0 • Public • Published

ascii-whitespace

A Node.js module containing a regular expression for ASCII/HTML whitespace, as defined by W3C and WHATWG.

ASCII whitespace means any combination of U+0009, U+000A, U+000C, U+000D, or U+0020.

Installation

npm install ascii-whitespace --save

Usage

const asciiWhitespace = require('ascii-whitespace')()

asciiWhitespace instanceof RegExp // true
asciiWhitespace.test(' ') // true

Spec References

W3C’s definition, from the HTML5 specification (retrieved 2017-03-07):

The space characters, for the purposes of this specification, are U+0020 SPACE, "tab" (U+0009), "LF" (U+000A), "FF" (U+000C), and "CR" (U+000D).

WHATWG's definition (retrieved 2017-03-07):

An ASCII whitespace is U+0009, U+000A, U+000C, U+000D, or U+0020.

Package Sidebar

Install

npm i ascii-whitespace

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • lamansky