Gathering detailed insights and metrics for wrap-ansi
Gathering detailed insights and metrics for wrap-ansi
Gathering detailed insights and metrics for wrap-ansi
Gathering detailed insights and metrics for wrap-ansi
npm install wrap-ansi
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
120 Stars
72 Commits
25 Forks
6 Watching
1 Branches
12 Contributors
Updated on 03 Oct 2024
JavaScript (96.74%)
TypeScript (3.26%)
Cumulative downloads
Total Downloads
Last day
-2.6%
30,014,362
Compared to previous day
Last week
3.3%
161,001,424
Compared to previous week
Last month
15.2%
655,888,934
Compared to previous month
Last year
47.1%
6,230,632,653
Compared to previous year
3
Wordwrap a string with ANSI escape codes
1npm install wrap-ansi
1import chalk from 'chalk'; 2import wrapAnsi from 'wrap-ansi'; 3 4const input = 'The quick brown ' + chalk.red('fox jumped over ') + 5 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); 6 7console.log(wrapAnsi(input, 20));
Wrap words to the specified column width.
Type: string
A string with ANSI escape codes, like one styled by chalk
.
Newline characters will be normalized to \n
.
Type: number
The number of columns to wrap the text to.
Type: object
Type: boolean
Default: false
By default the wrap is soft, meaning long words may extend past the column width. Setting this to true
will make it hard wrap at the column width.
Type: boolean
Default: true
By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is false
, each column will instead be completely filled splitting words as necessary.
Type: boolean
Default: true
Whitespace on all lines is removed by default. Set this option to false
if you don't want to trim.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 10/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
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