mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
657 B
35 lines
657 B
9 years ago
|
# code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at)
|
||
|
|
||
|
> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) ponyfill
|
||
|
|
||
|
> Ponyfill: A polyfill that doesn't overwrite the native method
|
||
|
|
||
|
|
||
|
## Install
|
||
|
|
||
|
```
|
||
|
$ npm install --save code-point-at
|
||
|
```
|
||
|
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
```js
|
||
|
var codePointAt = require('code-point-at');
|
||
|
|
||
|
codePointAt('🐴');
|
||
|
//=> 128052
|
||
|
|
||
|
codePointAt('abc', 2);
|
||
|
//=> 99
|
||
|
```
|
||
|
|
||
|
## API
|
||
|
|
||
|
### codePointAt(input, [position])
|
||
|
|
||
|
|
||
|
## License
|
||
|
|
||
|
MIT © [Sindre Sorhus](http://sindresorhus.com)
|