Skip to content
Create ansi colors by passing open and close codes.
JavaScript
Branch: master
Clone or download
Latest commit 45c711c May 23, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig first commit May 24, 2015
.gitattributes first commit May 24, 2015
.gitignore first commit May 24, 2015
.jshintrc first commit May 24, 2015
.travis.yml first commit May 24, 2015
.verb.md fix example May 24, 2015
LICENSE first commit May 24, 2015
README.md fix example May 24, 2015
index.js first commit May 24, 2015
package.json fix example May 24, 2015

README.md

ansi-wrap NPM version

Create ansi colors by passing open and close codes.

Install

Install with npm

$ npm i ansi-wrap --save

Usage

var wrap = require('ansi-wrap');

Example

Pass codes for ansi magenta background:

console.log(wrap(45, 49, 'This is a message...'));
//=> '\u001b[45mThis is a message...\u001b[49m'

Which prints out...

screen shot 2015-05-21 at 8 28 32 pm

Related projects

This is used in these projects:

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on May 24, 2015.

You can’t perform that action at this time.