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
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.3
Supply Chain
90.9
Quality
78.2
Maintenance
100
Vulnerability
100
License
JavaScript (96.74%)
TypeScript (3.26%)
Total Downloads
22,761,898,070
Last Day
28,170,466
Last Week
188,320,675
Last Month
763,895,761
Last Year
7,535,484,331
MIT License
125 Stars
72 Commits
25 Forks
4 Watchers
1 Branches
12 Contributors
Updated on May 20, 2025
Minified
Minified + Gzipped
Latest Version
9.0.0
Package Id
wrap-ansi@9.0.0
Unpacked Size
11.21 kB
Size
4.19 kB
File Count
5
NPM Version
9.2.0
Node Version
18.18.2
Published on
Oct 28, 2023
Cumulative downloads
Total Downloads
Last Day
-18.8%
28,170,466
Compared to previous day
Last Week
0.2%
188,320,675
Compared to previous week
Last Month
3.5%
763,895,761
Compared to previous month
Last Year
47.4%
7,535,484,331
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 binaries found in the repo
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
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 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