ascii-chr
Version:
ASCII character codes table
55 lines (43 loc) • 1.23 kB
Markdown
[](https://www.npmjs.com/package/ascii-chr)
[](LICENSE)
[](https://travis-ci.org/AlexMasterov/ascii-chr.js)
[](https://coveralls.io/github/AlexMasterov/ascii-chr.js?branch=master)
```sh
npm install ascii-chr
yarn add ascii-chr
```
```javascript
const {
charCode,
charCodes2: CHR2,
charCodes: CHR,
codePoint,
} = require('ascii-chr');
CHR[0] // \u0000 (NUL)
CHR[256] // \u0000 (NUL)
CHR[65535 & 0xff] // \u00ff (ÿ)
CHR2[1024] // \u0400 (Ѐ)
// Tree-shaking support
codePoint // String.fromCodePoint
charCode // String.fromCharCode
```
```javascript
const {
makeCharCodes,
makeCharCodes2,
} = require('ascii-chr/factories');
makeCharCodes() // ASCII+ (257)
makeCharCodes() // UTF-8 (2049)
```
Run tests as follows:
```
npm run test
```
ASCII CHR is licensed under MIT and can be used for any personal or commercial project.