https://github.com/nhsz/ordr
Given a string representing one Unicode character, return an integer representing the Unicode code point of that character. ES6 implementation of Python built-in ord() function
https://github.com/nhsz/ordr
char es6 nodejs npm npm-package ord python unicode
Last synced: 2 months ago
JSON representation
Given a string representing one Unicode character, return an integer representing the Unicode code point of that character. ES6 implementation of Python built-in ord() function
- Host: GitHub
- URL: https://github.com/nhsz/ordr
- Owner: nhsz
- License: mit
- Created: 2017-06-03T16:12:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-03T17:36:49.000Z (about 8 years ago)
- Last Synced: 2025-03-18T10:55:50.752Z (3 months ago)
- Topics: char, es6, nodejs, npm, npm-package, ord, python, unicode
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/ordr
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ordr
[](https://nodei.co/npm/ordr/)
> Given a string representing one Unicode character, return an integer representing the Unicode code point of that character.
ES6 implementation of **[`Python built-in ord()`](https://docs.python.org/3.6/library/functions.html#ord)** functionThis is the inverse of **[`char`](https://www.npmjs.com/package/char)**.
## Install
```
$ npm install --save ordr
```## Usage
```js
const ord = require('ordr')console.log(ord('A'))
// => 65console.log(ord('a'))
// => 97console.log(ord('€'))
// => 8364console.log(ord('@'))
// => 64
```## License
MIT © **[`Nicolás Quiroz`](https://nicolasquiroz.com)**