Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Mar 16, 2024 via pnpm
Package summary
Share
0
issues
1
license
9
MIT
Package created
19 Aug 2015
Version published
22 Apr 2020
Maintainers
2
Total deps
9
Direct deps
3
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
9 Packages, Including:
ansi-regex@5.0.1
ansi-styles@4.3.0
color-convert@2.0.1
color-name@1.1.4
emoji-regex@8.0.0
is-fullwidth-code-point@3.0.0
string-width@4.2.3
strip-ansi@6.0.1
wrap-ansi@7.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of wrap-ansi 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
ansi-styles4.3.05.71 kBMIT
prod
string-width4.2.32.33 kBMIT
prod
strip-ansi6.0.11.99 kBMIT
prod

Visualizations

Frequently Asked Questions

What does wrap-ansi do?

Wrap-ansi is a highly useful npm package that allows for word wrapping of a string with ANSI escape codes. An ANSI escape code is a sequence of characters that designates an action that should be taken by the software interpreting the text. These codes can be used to change text color, move the cursor, and perform other text manipulations. Wrap-ansi provides a function that wraps text containing these codes to a specified column width without breaking the ANSI escape sequences. This is particularly handy when string styling is done using libraries like chalk.

How do you use wrap-ansi?

To use wrap-ansi, first, it needs to be installed in your project using npm by running the command npm install wrap-ansi. You can then import it into your JavaScript file using import wrapAnsi from 'wrap-ansi'. Here's an example of how you can use wrap-ansi:

import chalk from 'chalk';
import wrapAnsi from 'wrap-ansi';

const input = 'The quick brown ' + chalk.red('fox jumped over ') +
	'the lazy ' + chalk.green('dog and then ran away with the unicorn.');

console.log(wrapAnsi(input, 20));

In this example, the string input is styled using the chalk library, then wrapped to a width of 20 columns using the wrapAnsi function. The output would be the string input styled and wrapped to 20 columns.

Where are the wrap-ansi docs?

The documentation for wrap-ansi can be found in the README file in the project's GitHub repository. The GitHub URL for the package is git+https://github.com/chalk/wrap-ansi.git. The instructions for installation, usage, and the API, including the options you can use with the wrapAnsi function (such as hard wrap, word wrap, trim options), can all be found in this README file.