Gathering detailed insights and metrics for printable-characters
Gathering detailed insights and metrics for printable-characters
Gathering detailed insights and metrics for printable-characters
Gathering detailed insights and metrics for printable-characters
printable-characters-regex
Regex for validating printable characters
printable-characters-plus-directional
A little helper for handling strings containing zero width control characters, ANSI styling, whitespaces, newlines, etc.
unicoderegexp
Regular expressions for various Unicode character classes extracted from XRegExp
univeil
Unveil some Unicode characters that are easily overlooked.
A little helper for handling strings containing zero width characters, ANSI styling, whitespaces, newlines, 💩, etc.
npm install printable-characters
Typescript
Module System
Node Version
NPM Version
99.8
Supply Chain
97
Quality
75.9
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
109,061,418
Last Day
294,780
Last Week
1,513,308
Last Month
6,785,160
Last Year
61,848,548
Unlicense License
20 Stars
104 Commits
6 Forks
4 Watchers
1 Branches
3 Contributors
Updated on Oct 26, 2024
Minified
Minified + Gzipped
Latest Version
1.0.42
Package Id
printable-characters@1.0.42
Unpacked Size
187.12 kB
Size
37.26 kB
File Count
13
NPM Version
2.15.11
Node Version
4.9.1
Cumulative downloads
Total Downloads
Last Day
-3.5%
294,780
Compared to previous day
Last Week
-7.3%
1,513,308
Compared to previous week
Last Month
13.1%
6,785,160
Compared to previous month
Last Year
80.1%
61,848,548
Compared to previous year
A little helper for handling strings containing zero width characters, ANSI styling, whitespaces, newlines, weird Unicode 💩 symbols, etc.
1const { strlen } = require ('printable-characters') 2 3strlen ('foo bar') // === 7 4strlen ('\u001b[106mfoo bar\u001b[49m') // === 7
1const { isBlank } = require ('printable-characters') 2 3isBlank ('foobar') // === false 4isBlank ('\u001b[106m \t \t \n \u001b[49m') // === true
1const { blank } = require ('printable-characters') 2 3blank ('💩') // === ' ' 4blank ('foo') // === ' ' 5blank ('\tfoo \nfoo') // === '\t \n ' 6blank ('\u001b[22m\u001b[1mfoo \t\u001b[39m\u001b[22m')) // === ' \t'
1const { ansiEscapeCodes, zeroWidthCharacters } = require ('printable-characters') 2 3const s = '\u001b[106m' + 'foo' + '\n' + 'bar' + '\u001b[49m' 4 5s.replace (ansiEscapeCodes, '') // === 'foo\nbar' 6 .replace (zeroWidthCharacters, '') // === 'foobar'
Use for safely truncating strings to maximum width without breaking ANSI codes:
1const { first } = require ('printable-characters') 2 3const s = '\u001b[22mfoobar\u001b[22m' 4 5first (s, 0) // === '\u001b[22m\u001b[22m' 6first (s, 1) // === '\u001b[22mf\u001b[22m' 7first (s, 3) // === '\u001b[22mfoo\u001b[22m' 8first (s, 6) // === '\u001b[22mfoobar\u001b[22m'
1const { partition } = require ('printable-characters') 2 3partition ('') // [ ]) 4partition ('foo') // [['', 'foo'] ]) 5partition ('\u001b[1mfoo') // [['\u001b[1m', 'foo'] ]) 6partition ('\u001b[1mfoo\u0000bar') // [['\u001b[1m', 'foo'], ['\u0000', 'bar'] ]) 7partition ('\u001b[1mfoo\u0000bar\n') // [['\u001b[1m', 'foo'], ['\u0000', 'bar'], ['\n', '']])
console.log
for the log-driven debugging junkies!Handle multi-component emojis, as in this article:
1assert.equal (strlen ('👩❤️💋👩'), 1) // FAILING, see http://blog.jonnew.com/posts/poo-dot-length-equals-two for possible solution 2assert.equal (blank ('👩❤️💋👩'), ' ') // FAILING, see http://blog.jonnew.com/posts/poo-dot-length-equals-two for possible solution
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
66 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-05-19
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More