https://github.com/ebukaodini/ascii-map
A lightweight representation of the ascii table that makes it easy to convert to and fro character, decimal, hexadecimal, octal, HTML code, HTML name.
https://github.com/ebukaodini/ascii-map
ascii decimal hexadecimal html-code javascript octal
Last synced: about 2 months ago
JSON representation
A lightweight representation of the ascii table that makes it easy to convert to and fro character, decimal, hexadecimal, octal, HTML code, HTML name.
- Host: GitHub
- URL: https://github.com/ebukaodini/ascii-map
- Owner: ebukaodini
- Created: 2022-06-05T02:39:36.000Z (almost 3 years ago)
- Default Branch: dev
- Last Pushed: 2022-06-05T12:03:04.000Z (almost 3 years ago)
- Last Synced: 2025-03-07T20:47:50.348Z (2 months ago)
- Topics: ascii, decimal, hexadecimal, html-code, javascript, octal
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/ascii-map
- Size: 11.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ascii-map
A lightweight representation of the ascii table that makes it easy to convert to and fro character, decimal, hexadecimal, octal, HTML code, HTML name.
## Install
```sh
npm install --save ascii-map
```## Usage
```js
const { char, dec, hex, oct, bin, htmlCode, htmlName } = require("ascii-map");char("A") // { dec: "65", hex: "41", oct: "101", bin: "01000001", htmlCode: "A", htmlName: undefined, char: "A", desc: "Upper Case Letter A" }
dec("65").bin // 01000001
hex("41").oct // 101
oct("101").char // A
bin("01000001").htmlCode // A
htmlCode("A").desc // Upper Case Letter A
htmlName("$").dec // 36
char("AA") // undefined
```
### Note
+ Characters without `htmlName` returns `undefined`.
+ Trying to read the properties of an undefined character throws `TypeError: Cannot read properties of undefined` error.Table was derived from https://www.lookuptables.com/text/ascii-table
### License
[MIT](https://choosealicense.com/licenses/mit/)