Installations
npm install univeil
Releases
Unable to fetch releases
Developer
mk-pmb
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
8.17.0
NPM Version
6.14.17
Statistics
1 Stars
17 Commits
2 Watching
1 Branches
1 Contributors
Updated on 21 Jul 2024
Languages
JavaScript (93.53%)
Shell (6.47%)
Total Downloads
Cumulative downloads
Total Downloads
10,430
Last day
-77.8%
2
Compared to previous day
Last week
-50%
13
Compared to previous week
Last month
-61.8%
71
Compared to previous month
Last year
-10.7%
1,415
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
univeil
Unveil some Unicode characters that are easily overlooked.
Security reminder
Although univeil
can replace characters with a backslash notation,
it is about visibility, not security.
It might protect your terminal emulator from that U+0090 device control,
but it won't care about your database or shell, since most quotes and
backslashes are perfectly visible characters.
(For JSON quotes, try univeil.jsonify
.)
Albeit an XML CharRef encoder is included, it usually won't be applied to the predefined entities, as they're perfectly visible. If you need them encoded as well, use xmlunidefuse instead.
Unicode feature reminders
- To fix decomposed vs. precomposed characters
(
'o\u0308'
='ö'
≠'ö'
), use String#normalize.
Usage
From test.js:
1var univeil = require('univeil'), cl = console.log, tmp; 2cl(univeil("Hello world!")); //= `Hello world!` 3cl(univeil("Hello snowman! ☃")); //= `Hel\u200Blo\u00A0snowman!\u205F☃` 4cl(univeil("foo \t \r \n")); //= `foo \u0009 \u000D \u000A` 5cl(univeil("\x1B \x7F \xA0 bar")); //= `\u001B \u007F \u00A0 bar` 6 7tmp = '\\,\t,\r,\n,\b,\xA0,\f'; 8cl(univeil(tmp)); //= `\,\u0009,\u000D,\u000A,\u0008,\u00A0,\u000C` 9cl(univeil(tmp, '\xA0\n')); // whitelist 10 //= `\,\u0009,\u000D,` 11 //= `,\u0008, ,\u000C` 12cl(univeil(tmp, { '\xA0': '<nbsp>', '\n': '<nl>', '': '<?!>' })); // dict 13 //= `\,<?!>,<?!>,<nl>,<?!>,<nbsp>,<?!>` 14cl(univeil(tmp, ' \n\xA0', { '': '' })); // whitelist + dict 15 //= `\,,,` 16 //= `,, ,` 17cl(univeil(tmp, encodeURIComponent)); // custom translator function 18 //= `\,%09,%0D,%0A,%08,%C2%A0,%0C` 19cl(univeil(tmp, univeil.xmlCharRef)); // some batteries included 20 //= `\,	, , ,, ,` 21// For more variants, see "Custom translations" below. 22 23tmp = [0, 1, 'nbsp=\xA0', 'devCtrl=\x90', { b: true }, null, -2]; 24cl(univeil.jsonify(tmp)); 25 //= `[0,1,"nbsp=\u00A0","devCtrl=\u0090",{"b":true},null,-2]` 26 27// Special reserved indentation "-1": spaces but no newlines. 28cl(univeil.jsonify(tmp, null, -1)); 29 //= `[0, 1, "nbsp=\u00A0", "devCtrl=\u0090", {"b": true}, null, -2]` 30 31tmp = univeil.funcProxy(cl, null, ['/+'], { '\xA0': '<nbsp>' }, ['+/']); 32tmp('hello\xA0world'); //= `/+ hello<nbsp>world +/`
CLI:
1$ head --lines=1 README.md | univeil 2\uFEFF
License
ISC
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
2.6
/10
Last Scanned on 2024-11-18
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