An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        

# ordr

[![NPM](https://nodei.co/npm/ordr.png?downloads=true&downloadRank=true&stars=true)](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)** function

This 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'))
// => 65

console.log(ord('a'))
// => 97

console.log(ord('€'))
// => 8364

console.log(ord('@'))
// => 64
```

## License

MIT © **[`Nicolás Quiroz`](https://nicolasquiroz.com)**