
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@pdf-lib/unicode-properties
Advanced tools
NOTE: All credit for this code belongs to the developers of https://github.com/devongovett/unicode-properties
This fork was created for use in https://github.com/Hopding/pdf-lib.
The original repository serialized and loaded the trie data using a binary file. This worked fine in Node, because fs.readFileSync was being called to load the serialized data into a Buffer object. In order to support use in the browser, Browserify and brfs were used to inline the binary data in the index.js file, and thereby remove the call to fs.readFileSync.
This works fine if you are in a Node environment, or are using Browserify to bundle your code for use in the browser. But it doesn't work so well if you aren't doing either of those things. E.g. I was writing an app built with create-react-app, and the binary data was not being inlined for this dependency.
I resolved this by simply serializing the trie data to a JSON file, which allows it to be loaded into the index.js file without using Browserify. Of course, this means that the trie data is not stored as efficiently, but that is not a concern for me.
Provides fast access to unicode character properties. Uses unicode-trie to compress the properties for all code points into just 12KB.
npm install unicode-properties
var unicode = require('unicode-properties');
unicode.getCategory('2'.charCodeAt()) //=> 'Nd'
unicode.getNumericValue('2'.charCodeAt()) //=> 2
Returns the unicode general category for the given code point.
Returns the script for the given code point.
Returns the canonical combining class for the given code point.
Returns the East Asian width for the given code point.
Returns the numeric value for the given code point, or null if there is no numeric value for that code point.
Returns whether the code point is an alphabetic character.
Returns whether the code point is a digit.
Returns whether the code point is a punctuation character.
Returns whether the code point is lower case.
Returns whether the code point is upper case.
Returns whether the code point is title case.
Returns whether the code point is whitespace: specifically, whether the category is one of Zs, Zl, or Zp.
Returns whether the code point is a base form. A code point of base form does not graphically combine with preceding characters.
Returns whether the code point is a mark character (e.g. accent).
MIT
FAQs
Provides fast access to unicode character properties
The npm package @pdf-lib/unicode-properties receives a total of 26 weekly downloads. As such, @pdf-lib/unicode-properties popularity was classified as not popular.
We found that @pdf-lib/unicode-properties 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.