Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.