1 |
3a515b92
|
cagy
|
# code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at)
|
2 |
|
|
|
3 |
|
|
> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) [ponyfill](https://ponyfill.com)
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
## Install
|
7 |
|
|
|
8 |
|
|
```
|
9 |
|
|
$ npm install --save code-point-at
|
10 |
|
|
```
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
## Usage
|
14 |
|
|
|
15 |
|
|
```js
|
16 |
|
|
var codePointAt = require('code-point-at');
|
17 |
|
|
|
18 |
|
|
codePointAt('🐴');
|
19 |
|
|
//=> 128052
|
20 |
|
|
|
21 |
|
|
codePointAt('abc', 2);
|
22 |
|
|
//=> 99
|
23 |
|
|
```
|
24 |
|
|
|
25 |
|
|
## API
|
26 |
|
|
|
27 |
|
|
### codePointAt(input, [position])
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
## License
|
31 |
|
|
|
32 |
|
|
MIT © [Sindre Sorhus](https://sindresorhus.com)
|