https://github.com/nhsz/char
Get the string representing a character whose Unicode code point is the integer i. ES6 implementation of Python built-in chr() function
https://github.com/nhsz/char
char es6 nodejs npm npm-package python unicode
Last synced: 10 months ago
JSON representation
Get the string representing a character whose Unicode code point is the integer i. ES6 implementation of Python built-in chr() function
- Host: GitHub
- URL: https://github.com/nhsz/char
- Owner: nhsz
- License: mit
- Created: 2017-06-03T15:18:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-11T15:45:34.000Z (over 8 years ago)
- Last Synced: 2025-03-09T01:33:14.374Z (11 months ago)
- Topics: char, es6, nodejs, npm, npm-package, python, unicode
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/char
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# char
> Return the string representing a character whose Unicode code point is the integer `code`.
ES6 implementation of **[`Python built-in chr()`](https://docs.python.org/3.6/library/functions.html#chr)** function
[](https://travis-ci.org/nhsz/char)
[](https://coveralls.io/github/nhsz/char?branch=master)
[](https://codebeat.co/projects/github-com-nhsz-char-master)
[](https://www.codacy.com/app/nquiroz/char?utm_source=github.com&utm_medium=referral&utm_content=nhsz/char&utm_campaign=Badge_Grade)
[](https://codeclimate.com/github/nhsz/char)
[](https://nodei.co/npm/char/)
This is the inverse of **[`ordr`](https://www.npmjs.com/package/ordr)**.
**The valid range for the argument is from 0 through 1114111 (0x10FFFF in base 16)**. RangeError will be raised if `code` is outside that range.
## Install
```
$ npm install char
```
## Usage
```js
const chr = require('char')
console.log(chr(65))
// => 'A'
console.log(chr(97))
// => 'a'
console.log(chr(8364))
// => '€'
console.log(chr(64))
// => '@'
console.log(chr(-1))
// => RangeError: Invalid code point -1
```
## License
MIT © **[`Nicolás Quiroz`](https://nicolasquiroz.com)**