package/package.json000644 000765 000024 0000005141 13242345152013017 0ustar00000000 000000 { "name": "ansi-colors", "description": "Collection of ansi colors and styles.", "version": "1.1.0", "homepage": "https://github.com/doowb/ansi-colors", "author": "Brian Woodward (https://github.com/doowb)", "contributors": [ "Brian Woodward (https://twitter.com/doowb)", "Jon Schlinkert (http://twitter.com/jonschlinkert)" ], "repository": "doowb/ansi-colors", "bugs": { "url": "https://github.com/doowb/ansi-colors/issues" }, "license": "MIT", "files": [ "index.js", "types/index.d.ts" ], "main": "index.js", "types": "./types/index.d.ts", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha && tsc --project types" }, "dependencies": { "ansi-wrap": "^0.1.0" }, "devDependencies": { "gulp-format-md": "^1.0.0", "mocha": "^3.5.3", "typescript": "^2.7.1" }, "keywords": [ "ansi-bgblack", "ansi-bgblue", "ansi-bgcyan", "ansi-bggreen", "ansi-bgmagenta", "ansi-bgred", "ansi-bgwhite", "ansi-bgyellow", "ansi-black", "ansi-blue", "ansi-bold", "ansi-cyan", "ansi-dim", "ansi-gray", "ansi-green", "ansi-grey", "ansi-hidden", "ansi-inverse", "ansi-italic", "ansi-magenta", "ansi-red", "ansi-reset", "ansi-strikethrough", "ansi-underline", "ansi-white", "ansi-yellow", "bgblack", "bgblue", "bgcyan", "bggreen", "bgmagenta", "bgred", "bgwhite", "bgyellow", "black", "blue", "bold", "cyan", "dim", "gray", "green", "grey", "hidden", "inverse", "italic", "magenta", "red", "reset", "strikethrough", "underline", "white", "yellow" ], "verb": { "toc": false, "layout": "default", "tasks": [ "readme" ], "plugins": [ "gulp-format-md" ], "lint": { "reflinks": true }, "reflinks": [ "verb-readme-generator", "verb" ], "related": { "list": [ "ansi-bgblack", "ansi-bgblue", "ansi-bgcyan", "ansi-bggreen", "ansi-bgmagenta", "ansi-bgred", "ansi-bgwhite", "ansi-bgyellow", "ansi-black", "ansi-blue", "ansi-bold", "ansi-cyan", "ansi-dim", "ansi-gray", "ansi-green", "ansi-grey", "ansi-hidden", "ansi-inverse", "ansi-italic", "ansi-magenta", "ansi-red", "ansi-reset", "ansi-strikethrough", "ansi-underline", "ansi-white", "ansi-wrap", "ansi-yellow" ] } } } package/README.md000644 000765 000024 0000016706 13242344101012012 0ustar00000000 000000 # ansi-colors [![NPM version](https://img.shields.io/npm/v/ansi-colors.svg?style=flat)](https://www.npmjs.com/package/ansi-colors) [![NPM monthly downloads](https://img.shields.io/npm/dm/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![NPM total downloads](https://img.shields.io/npm/dt/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![Linux Build Status](https://img.shields.io/travis/doowb/ansi-colors.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/ansi-colors) [![Windows Build Status](https://img.shields.io/appveyor/ci/doowb/ansi-colors.svg?style=flat&label=AppVeyor)](https://ci.appveyor.com/project/doowb/ansi-colors) > Collection of ansi colors and styles. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save ansi-colors ``` ## Usage This module exports an object of functions. Each function wraps a string with the ansi codes used to display the string with that color (or style). Use the wrapped string with `console.log`: ```js var colors = require('ansi-colors'); console.log(colors.bold(colors.cyan('[info]')), colors.cyan('This is some information')); console.log(colors.bold(colors.yellow('[warning]')), colors.yellow('This is a warning')); console.error(colors.bold(colors.red('[ERROR]')), colors.red('Danger! There was an error!')); ``` ![image](https://user-images.githubusercontent.com/995160/34897845-3150daae-f7be-11e7-9706-38c42461e0ee.png) ## Example See the [example](./example.js) for more colors and styles. ## About ### Related projects * [ansi-bgblack](https://www.npmjs.com/package/ansi-bgblack): The color bgblack, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgblack "The color bgblack, in ansi.") * [ansi-bgblue](https://www.npmjs.com/package/ansi-bgblue): The color bgblue, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgblue "The color bgblue, in ansi.") * [ansi-bgcyan](https://www.npmjs.com/package/ansi-bgcyan): The color bgcyan, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgcyan "The color bgcyan, in ansi.") * [ansi-bggreen](https://www.npmjs.com/package/ansi-bggreen): The color bggreen, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bggreen "The color bggreen, in ansi.") * [ansi-bgmagenta](https://www.npmjs.com/package/ansi-bgmagenta): The color bgmagenta, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgmagenta "The color bgmagenta, in ansi.") * [ansi-bgred](https://www.npmjs.com/package/ansi-bgred): The color bgred, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgred "The color bgred, in ansi.") * [ansi-bgwhite](https://www.npmjs.com/package/ansi-bgwhite): The color bgwhite, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgwhite "The color bgwhite, in ansi.") * [ansi-bgyellow](https://www.npmjs.com/package/ansi-bgyellow): The color bgyellow, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bgyellow "The color bgyellow, in ansi.") * [ansi-black](https://www.npmjs.com/package/ansi-black): The color black, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-black "The color black, in ansi.") * [ansi-blue](https://www.npmjs.com/package/ansi-blue): The color blue, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-blue "The color blue, in ansi.") * [ansi-bold](https://www.npmjs.com/package/ansi-bold): The color bold, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-bold "The color bold, in ansi.") * [ansi-cyan](https://www.npmjs.com/package/ansi-cyan): The color cyan, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-cyan "The color cyan, in ansi.") * [ansi-dim](https://www.npmjs.com/package/ansi-dim): The color dim, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-dim "The color dim, in ansi.") * [ansi-gray](https://www.npmjs.com/package/ansi-gray): The color gray, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-gray "The color gray, in ansi.") * [ansi-green](https://www.npmjs.com/package/ansi-green): The color green, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-green "The color green, in ansi.") * [ansi-grey](https://www.npmjs.com/package/ansi-grey): The color grey, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-grey "The color grey, in ansi.") * [ansi-hidden](https://www.npmjs.com/package/ansi-hidden): The color hidden, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-hidden "The color hidden, in ansi.") * [ansi-inverse](https://www.npmjs.com/package/ansi-inverse): The color inverse, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-inverse "The color inverse, in ansi.") * [ansi-italic](https://www.npmjs.com/package/ansi-italic): The color italic, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-italic "The color italic, in ansi.") * [ansi-magenta](https://www.npmjs.com/package/ansi-magenta): The color magenta, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-magenta "The color magenta, in ansi.") * [ansi-red](https://www.npmjs.com/package/ansi-red): The color red, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-red "The color red, in ansi.") * [ansi-reset](https://www.npmjs.com/package/ansi-reset): The color reset, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-reset "The color reset, in ansi.") * [ansi-strikethrough](https://www.npmjs.com/package/ansi-strikethrough): The color strikethrough, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-strikethrough "The color strikethrough, in ansi.") * [ansi-underline](https://www.npmjs.com/package/ansi-underline): The color underline, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-underline "The color underline, in ansi.") * [ansi-white](https://www.npmjs.com/package/ansi-white): The color white, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-white "The color white, in ansi.") * [ansi-wrap](https://www.npmjs.com/package/ansi-wrap): Create ansi colors by passing the open and close codes. | [homepage](https://github.com/jonschlinkert/ansi-wrap "Create ansi colors by passing the open and close codes.") * [ansi-yellow](https://www.npmjs.com/package/ansi-yellow): The color yellow, in ansi. | [homepage](https://github.com/jonschlinkert/ansi-yellow "The color yellow, in ansi.") ### Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). ### Contributors | **Commits** | **Contributor** | | --- | --- | | 10 | [doowb](https://github.com/doowb) | | 3 | [jonschlinkert](https://github.com/jonschlinkert) | ### Building docs _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ To generate the readme, run the following command: ```sh $ npm install -g verbose/verb#dev verb-generate-readme && verb ``` ### Running tests Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: ```sh $ npm install && npm test ``` ### Author **Brian Woodward** * [github/doowb](https://github.com/doowb) * [twitter/doowb](https://twitter.com/doowb) ### License Copyright © 2018, [Brian Woodward](https://github.com/doowb). Released under the [MIT License](LICENSE). *** _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on January 12, 2018._package/LICENSE000644 000765 000024 0000002100 13212054733011525 0ustar00000000 000000 The MIT License (MIT) Copyright (c) 2015-2017, Brian Woodward. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. package/index.js000644 000765 000024 0000021646 13242344502012204 0ustar00000000 000000 /*! * ansi-colors * * Copyright (c) 2015-2017, Brian Woodward. * Released under the MIT License. */ 'use strict'; /** * Module dependencies */ var wrap = require('ansi-wrap'); /** * Wrap a string with ansi codes to create a black background. * * ```js * console.log(colors.bgblack('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name bgblack */ exports.bgblack = function bgblack(message) { return wrap(40, 49, message); }; /** * Wrap a string with ansi codes to create a blue background. * * ```js * console.log(colors.bgblue('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name bgblue */ exports.bgblue = function bgblue(message) { return wrap(44, 49, message); }; /** * Wrap a string with ansi codes to create a cyan background. * * ```js * console.log(colors.bgcyan('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name bgcyan */ exports.bgcyan = function bgcyan(message) { return wrap(46, 49, message); }; /** * Wrap a string with ansi codes to create a green background. * * ```js * console.log(colors.bggreen('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name bggreen */ exports.bggreen = function bggreen(message) { return wrap(42, 49, message); }; /** * Wrap a string with ansi codes to create a magenta background. * * ```js * console.log(colors.bgmagenta('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name bgmagenta */ exports.bgmagenta = function bgmagenta(message) { return wrap(45, 49, message); }; /** * Wrap a string with ansi codes to create a red background. * * ```js * console.log(colors.bgred('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name bgred */ exports.bgred = function bgred(message) { return wrap(41, 49, message); }; /** * Wrap a string with ansi codes to create a white background. * * ```js * console.log(colors.bgwhite('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name bgwhite */ exports.bgwhite = function bgwhite(message) { return wrap(47, 49, message); }; /** * Wrap a string with ansi codes to create a yellow background. * * ```js * console.log(colors.bgyellow('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name bgyellow */ exports.bgyellow = function bgyellow(message) { return wrap(43, 49, message); }; /** * Wrap a string with ansi codes to create black text. * * ```js * console.log(colors.black('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name black */ exports.black = function black(message) { return wrap(30, 39, message); }; /** * Wrap a string with ansi codes to create blue text. * * ```js * console.log(colors.blue('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name blue */ exports.blue = function blue(message) { return wrap(34, 39, message); }; /** * Wrap a string with ansi codes to create bold text. * * ```js * console.log(colors.bold('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name bold */ exports.bold = function bold(message) { return wrap(1, 22, message); }; /** * Wrap a string with ansi codes to create cyan text. * * ```js * console.log(colors.cyan('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name cyan */ exports.cyan = function cyan(message) { return wrap(36, 39, message); }; /** * Wrap a string with ansi codes to create dim text. * * ```js * console.log(colors.dim('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name dim */ exports.dim = function dim(message) { return wrap(2, 22, message); }; /** * Wrap a string with ansi codes to create gray text. * * ```js * console.log(colors.gray('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name gray */ exports.gray = function gray(message) { return wrap(90, 39, message); }; /** * Wrap a string with ansi codes to create green text. * * ```js * console.log(colors.green('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name green */ exports.green = function green(message) { return wrap(32, 39, message); }; /** * Wrap a string with ansi codes to create grey text. * * ```js * console.log(colors.grey('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name grey */ exports.grey = function grey(message) { return wrap(90, 39, message); }; /** * Wrap a string with ansi codes to create hidden text. * * ```js * console.log(colors.hidden('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name hidden */ exports.hidden = function hidden(message) { return wrap(8, 28, message); }; /** * Wrap a string with ansi codes to create inverse text. * * ```js * console.log(colors.inverse('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name inverse */ exports.inverse = function inverse(message) { return wrap(7, 27, message); }; /** * Wrap a string with ansi codes to create italic text. * * ```js * console.log(colors.italic('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name italic */ exports.italic = function italic(message) { return wrap(3, 23, message); }; /** * Wrap a string with ansi codes to create magenta text. * * ```js * console.log(colors.magenta('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name magenta */ exports.magenta = function magenta(message) { return wrap(35, 39, message); }; /** * Wrap a string with ansi codes to create red text. * * ```js * console.log(colors.red('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name red */ exports.red = function red(message) { return wrap(31, 39, message); }; /** * Wrap a string with ansi codes to reset ansi colors currently on the string. * * ```js * console.log(colors.reset('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name reset */ exports.reset = function reset(message) { return wrap(0, 0, message); }; /** * Wrap a string with ansi codes to add a strikethrough to the text. * * ```js * console.log(colors.strikethrough('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name strikethrough */ exports.strikethrough = function strikethrough(message) { return wrap(9, 29, message); }; /** * Wrap a string with ansi codes to underline the text. * * ```js * console.log(colors.underline('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name underline */ exports.underline = function underline(message) { return wrap(4, 24, message); }; /** * Wrap a string with ansi codes to create white text. * * ```js * console.log(colors.white('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name white */ exports.white = function white(message) { return wrap(37, 39, message); }; /** * Wrap a string with ansi codes to create yellow text. * * ```js * console.log(colors.yellow('some string')); * ``` * * @param {string} message String to wrap with ansi codes. * @return {string} Wrapped string * @api public * @name yellow */ exports.yellow = function yellow(message) { return wrap(33, 39, message); }; package/types/index.d.ts000644 000765 000024 0000002734 13242343766013614 0ustar00000000 000000 // Imported from from DefinitelyTyped project. // TypeScript definitions for ansi-colors // Definitions by: Rogier Schouten // Integrated by: Jordan Mele export function bgblack(message: string): string; export function bgblue(message: string): string; export function bgcyan(message: string): string; export function bggreen(message: string): string; export function bgmagenta(message: string): string; export function bgred(message: string): string; export function bgwhite(message: string): string; export function bgyellow(message: string): string; export function black(message: string): string; export function blue(message: string): string; export function bold(message: string): string; export function cyan(message: string): string; export function dim(message: string): string; export function gray(message: string): string; export function green(message: string): string; export function grey(message: string): string; export function hidden(message: string): string; export function inverse(message: string): string; export function italic(message: string): string; export function magenta(message: string): string; export function red(message: string): string; export function reset(message: string): string; export function strikethrough(message: string): string; export function underline(message: string): string; export function white(message: string): string; export function yellow(message: string): string;