You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

code-point-at

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-point-at

ES2015 `String#codePointAt()` ponyfill


Version published
Weekly downloads
8.4M
decreased by-2.55%
Maintainers
1
Install size
3.79 kB
Created
Weekly downloads
 

Package description

What is code-point-at?

The 'code-point-at' npm package provides functionality to retrieve a Unicode code point from a string at a given position. This is particularly useful for handling Unicode characters that are represented by two JavaScript characters (surrogate pairs).

What are code-point-at's main functionalities?

Get code point at specific position

This feature allows you to retrieve the Unicode code point of a character at a specified position in a string. It is especially useful for strings containing characters that may be represented by surrogate pairs in JavaScript.

const codePointAt = require('code-point-at');
let str = '𠮷野家';
let codePoint = codePointAt(str, 0);
console.log(codePoint); // 134071

Other packages similar to code-point-at

Readme

Source

Deprecated. Just use String#codePointAt().


code-point-at

ES2015 String#codePointAt() ponyfill

Install

$ npm install --save code-point-at

Usage

var codePointAt = require('code-point-at');

codePointAt('🐴');
//=> 128052

codePointAt('abc', 2);
//=> 99

API

codePointAt(input, [position])

Keywords

FAQs

Package last updated on 13 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc