mirror of
https://github.com/nodejs/node.git
synced 2025-05-15 14:41:29 +00:00

PR-URL: https://github.com/nodejs/node/pull/20190 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
33 lines
617 B
Markdown
33 lines
617 B
Markdown
# code-point-at [](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](https://ponyfill.com)
|
|
|
|
|
|
## 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](https://sindresorhus.com)
|