
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@blac-sheep/character-count
Advanced tools
Counting characters in a string seems like a trivial thing until emojis get involved. This simple function will allow you to count emojis in a string as a single character each.
This library is provided as an UMD module that can be installed by adding the files manually to your project or via a package manager.
Yarn
yarn add @blac-sheep/character-count
NPM
npm install @blac-sheep/character-count
Adding it manually
<script src="character-count.min.js"></script>
NodeJS
const characterCount = require('@blac-sheep/character-count').default;
ES6
import characterCount from '@blac-sheep/character-count';
Browser
const characterCount = CharacterCount.default;
countCharacters('Hi there! 👩🏿🦽'); // returns: 11
countCharacters('🤲🏿'); // returns: 1
countCharacters('👩👧👧'); // returns: 1
countCharacters('👩👧👧👩👧👧'); // returns: 2
countCharacters('👩👧👧👩👧👧👩👧👧'); // returns: 3
countCharacters('😀'); // returns: 1
This library is released under the MIT license.
FAQs
A simple utility to count characters in a string equally.
We found that @blac-sheep/character-count 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.