├── .editorconfig ├── .gitattributes ├── .gitignore ├── .jshintrc ├── .verb.md ├── LICENSE ├── index.js ├── package.json ├── readme.md └── test.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | end_of_line = lf 7 | charset = utf-8 8 | indent_size = 2 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | insert_final_newline = false 15 | 16 | [test/**] 17 | trim_trailing_whitespace = false 18 | insert_final_newline = false 19 | 20 | [templates/**] 21 | trim_trailing_whitespace = false 22 | insert_final_newline = false 23 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour, in case users don't have core.autocrlf set. 2 | * text=lf 3 | * text eol=lf 4 | *.* eol=lf 5 | 6 | *.jpg binary 7 | *.gif binary 8 | *.png binary 9 | *.jpeg binary 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | *.sublime-* 3 | .npm-debug.log 4 | node_modules 5 | temp 6 | tmp 7 | actual 8 | test/actual 9 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "asi": false, 3 | "boss": true, 4 | "curly": true, 5 | "eqeqeq": true, 6 | "eqnull": true, 7 | "esnext": true, 8 | "immed": true, 9 | "latedef": false, 10 | "laxcomma": false, 11 | "mocha": true, 12 | "newcap": true, 13 | "noarg": true, 14 | "node": true, 15 | "sub": true, 16 | "undef": true, 17 | "unused": true 18 | } 19 | -------------------------------------------------------------------------------- /.verb.md: -------------------------------------------------------------------------------- 1 | # {%= name %} {%= badge("fury") %} 2 | 3 | > {%= description %} 4 | 5 | ## Install 6 | {%= include("install-npm", {save: true}) %} 7 | 8 | ## Usage 9 | 10 | ```js 11 | var red = require('{%= name %}'); 12 | ``` 13 | 14 | ## Related projects 15 | 16 | + [ansi-reset](https://github.com/jonschlinkert/ansi-reset) 17 | + [ansi-bold](https://github.com/jonschlinkert/ansi-bold) 18 | + [ansi-dim](https://github.com/jonschlinkert/ansi-dim) 19 | + [ansi-italic](https://github.com/jonschlinkert/ansi-italic) 20 | + [ansi-underline](https://github.com/jonschlinkert/ansi-underline) 21 | + [ansi-inverse](https://github.com/jonschlinkert/ansi-inverse) 22 | + [ansi-hidden](https://github.com/jonschlinkert/ansi-hidden) 23 | + [ansi-strikethrough](https://github.com/jonschlinkert/ansi-strikethrough) 24 | + [ansi-black](https://github.com/jonschlinkert/ansi-black) 25 | + [ansi-red](https://github.com/jonschlinkert/ansi-red) 26 | + [ansi-green](https://github.com/jonschlinkert/ansi-green) 27 | + [ansi-yellow](https://github.com/jonschlinkert/ansi-yellow) 28 | + [ansi-blue](https://github.com/jonschlinkert/ansi-blue) 29 | + [ansi-magenta](https://github.com/jonschlinkert/ansi-magenta) 30 | + [ansi-cyan](https://github.com/jonschlinkert/ansi-cyan) 31 | + [ansi-white](https://github.com/jonschlinkert/ansi-white) 32 | + [ansi-gray](https://github.com/jonschlinkert/ansi-gray) 33 | + [ansi-grey](https://github.com/jonschlinkert/ansi-grey) 34 | + [ansi-bgblack](https://github.com/jonschlinkert/ansi-bgblack) 35 | + [ansi-bgred](https://github.com/jonschlinkert/ansi-bgred) 36 | + [ansi-bggreen](https://github.com/jonschlinkert/ansi-bggreen) 37 | + [ansi-bgyellow](https://github.com/jonschlinkert/ansi-bgyellow) 38 | + [ansi-bgblue](https://github.com/jonschlinkert/ansi-bgblue) 39 | + [ansi-bgmagenta](https://github.com/jonschlinkert/ansi-bgmagenta) 40 | + [ansi-bgcyan](https://github.com/jonschlinkert/ansi-bgcyan) 41 | + [ansi-bgwhite](https://github.com/jonschlinkert/ansi-bgwhite) 42 | 43 | ## Running tests 44 | {%= include("tests") %} 45 | 46 | ## Contributing 47 | {%= include("contributing") %} 48 | 49 | ## Author 50 | {%= include("author") %} 51 | 52 | ## License 53 | {%= copyright({start: 2015}) %} 54 | {%= license() %} 55 | 56 | *** 57 | 58 | {%= include("footer") %} 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) <%= year() %>, Jon Schlinkert. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * ansi-red 3 | * 4 | * Copyright (c) 2015, Jon Schlinkert. 5 | * Licensed under the MIT License. 6 | */ 7 | 8 | 'use strict'; 9 | 10 | var wrap = require('ansi-wrap'); 11 | 12 | module.exports = function red(message) { 13 | return wrap(31, 39, message); 14 | }; 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ansi-red", 3 | "description": "The color red, in ansi.", 4 | "version": "0.1.1", 5 | "homepage": "https://github.com/jonschlinkert/ansi-red", 6 | "author": "Jon Schlinkert (https://github.com/jonschlinkert)", 7 | "repository": "jonschlinkert/ansi-red", 8 | "bugs": { 9 | "url": "https://github.com/jonschlinkert/ansi-red/issues" 10 | }, 11 | "license": "MIT", 12 | "files": [ 13 | "index.js" 14 | ], 15 | "main": "index.js", 16 | "engines": { 17 | "node": ">=0.10.0" 18 | }, 19 | "scripts": { 20 | "test": "mocha" 21 | }, 22 | "dependencies": { 23 | "ansi-wrap": "0.1.0" 24 | }, 25 | "devDependencies": { 26 | "mocha": "*" 27 | }, 28 | "keywords": [ 29 | "red", 30 | "256", 31 | "ansi", 32 | "cli", 33 | "color", 34 | "colors", 35 | "colour", 36 | "command", 37 | "command-line", 38 | "console", 39 | "format", 40 | "formatting", 41 | "iterm", 42 | "log", 43 | "logging", 44 | "rgb", 45 | "shell", 46 | "string", 47 | "style", 48 | "styles", 49 | "styling", 50 | "terminal", 51 | "text", 52 | "tty", 53 | "xterm" 54 | ] 55 | } 56 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # ansi-red [![NPM version](https://badge.fury.io/js/ansi-red.svg)](http://badge.fury.io/js/ansi-red) 2 | 3 | > The color red, in ansi. 4 | 5 | ## Install 6 | 7 | Install with [npm](https://www.npmjs.com/) 8 | 9 | ```sh 10 | $ npm i ansi-red --save 11 | ``` 12 | 13 | ## Usage 14 | 15 | ```js 16 | var red = require('ansi-red'); 17 | ``` 18 | 19 | ## Related projects 20 | 21 | * [ansi-reset](https://github.com/jonschlinkert/ansi-reset) 22 | * [ansi-bold](https://github.com/jonschlinkert/ansi-bold) 23 | * [ansi-dim](https://github.com/jonschlinkert/ansi-dim) 24 | * [ansi-italic](https://github.com/jonschlinkert/ansi-italic) 25 | * [ansi-underline](https://github.com/jonschlinkert/ansi-underline) 26 | * [ansi-inverse](https://github.com/jonschlinkert/ansi-inverse) 27 | * [ansi-hidden](https://github.com/jonschlinkert/ansi-hidden) 28 | * [ansi-strikethrough](https://github.com/jonschlinkert/ansi-strikethrough) 29 | * [ansi-black](https://github.com/jonschlinkert/ansi-black) 30 | * [ansi-red](https://github.com/jonschlinkert/ansi-red) 31 | * [ansi-green](https://github.com/jonschlinkert/ansi-green) 32 | * [ansi-yellow](https://github.com/jonschlinkert/ansi-yellow) 33 | * [ansi-blue](https://github.com/jonschlinkert/ansi-blue) 34 | * [ansi-magenta](https://github.com/jonschlinkert/ansi-magenta) 35 | * [ansi-cyan](https://github.com/jonschlinkert/ansi-cyan) 36 | * [ansi-white](https://github.com/jonschlinkert/ansi-white) 37 | * [ansi-gray](https://github.com/jonschlinkert/ansi-gray) 38 | * [ansi-grey](https://github.com/jonschlinkert/ansi-grey) 39 | * [ansi-bgblack](https://github.com/jonschlinkert/ansi-bgblack) 40 | * [ansi-bgred](https://github.com/jonschlinkert/ansi-bgred) 41 | * [ansi-bggreen](https://github.com/jonschlinkert/ansi-bggreen) 42 | * [ansi-bgyellow](https://github.com/jonschlinkert/ansi-bgyellow) 43 | * [ansi-bgblue](https://github.com/jonschlinkert/ansi-bgblue) 44 | * [ansi-bgmagenta](https://github.com/jonschlinkert/ansi-bgmagenta) 45 | * [ansi-bgcyan](https://github.com/jonschlinkert/ansi-bgcyan) 46 | * [ansi-bgwhite](https://github.com/jonschlinkert/ansi-bgwhite) 47 | 48 | ## Running tests 49 | 50 | Install dev dependencies: 51 | 52 | ```sh 53 | $ npm i -d && npm test 54 | ``` 55 | 56 | ## Contributing 57 | 58 | Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/ansi-red/issues/new) 59 | 60 | ## Author 61 | 62 | **Jon Schlinkert** 63 | 64 | + [github/jonschlinkert](https://github.com/jonschlinkert) 65 | + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) 66 | 67 | ## License 68 | 69 | Copyright © 2015 Jon Schlinkert 70 | Released under the MIT license. 71 | 72 | *** 73 | 74 | _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on May 21, 2015._ -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /* deps: mocha */ 4 | var assert = require('assert'); 5 | var red = require('./'); 6 | 7 | describe('red', function () { 8 | it('should wrap a string with ansi styling:', function () { 9 | assert.equal(red('string'), '\u001b[31mstring\u001b[39m'); 10 | }); 11 | }); 12 | --------------------------------------------------------------------------------