Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
code-point-at
Advanced tools
Package description
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).
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
This package is a polyfill for the String.prototype.codePointAt() method defined in ECMAScript 2015 (ES6). It offers similar functionality to 'code-point-at' by allowing retrieval of the code point of a character at a given position in a string. The main difference is that 'string.prototype.codepointat' extends the String prototype, making it available as a method on any string instance, whereas 'code-point-at' is used by requiring the module and calling it as a function.
Punycode.js is a robust Punycode converter that fully complies with RFC 3492 and RFC 5891, and works in nearly all JavaScript environments. This package includes functionality to handle Unicode code points, which can be seen as similar in handling specific Unicode operations like 'code-point-at'. However, Punycode.js is more focused on encoding and decoding between Unicode and ASCII characters, particularly for internationalized domain names (IDNs), making it broader in scope compared to the specific functionality of 'code-point-at'.
Readme
Deprecated. Just use String#codePointAt()
.
ES2015
String#codePointAt()
ponyfill
$ npm install --save code-point-at
var codePointAt = require('code-point-at');
codePointAt('🐴');
//=> 128052
codePointAt('abc', 2);
//=> 99
FAQs
ES2015 `String#codePointAt()` ponyfill
The npm package code-point-at receives a total of 6,869,154 weekly downloads. As such, code-point-at popularity was classified as popular.
We found that code-point-at demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.