
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@demouth/mb_strwidth
Advanced tools
Calculates the width of a string, where halfwidth characters count as 1, and fullwidth characters count as 2.
mb_strwidth ported to JavaScript.
Calculates the width of a string, where halfwidth characters count as 1, and fullwidth characters count as 2. See » http://www.unicode.org/reports/tr11/ for details regarding East Asian character widths.
Using npm:
npm install @demouth/mb_strwidth
Using unpkg CDN:
<script src="https://unpkg.com/@demouth/mb_strwidth@2.0.2/dist/mb_strwidth.min.js"></script>
This package has the same result as mb_strwidth()
in PHP.
ES Module:
import { mb_strwidth } from "@demouth/mb_strwidth";
console.log(mb_strwidth("𠮷野家")); // 6
CommonJS:
const { mb_strwidth } = require("@demouth/mb_strwidth");
console.log(mb_strwidth("𩸽定食食べたい😭")); // 15
Browser:
<script src="https://unpkg.com/@demouth/mb_strwidth@2.0.3/dist/mb_strwidth.min.js"></script>
<script>
console.log(mb_strwidth("𩸽定食食べたい😭")); // 15
</script>
Reference(PHP 7.3.28):
var_dump(mb_strwidth('𩸽定食食べたい😭')); // int(15)
FAQs
Calculates the width of a string, where halfwidth characters count as 1, and fullwidth characters count as 2.
We found that @demouth/mb_strwidth 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.