package/package.json000644 000765 000024 0000001412 12527472524013025 0ustar00000000 000000 { "name": "ansi-wrap", "description": "Create ansi colors by passing the open and close codes.", "version": "0.1.0", "homepage": "https://github.com/jonschlinkert/ansi-wrap", "author": { "name": "Jon Schlinkert", "url": "https://github.com/jonschlinkert" }, "repository": { "type": "git", "url": "https://github.com/jonschlinkert/ansi-wrap.git" }, "bugs": { "url": "https://github.com/jonschlinkert/ansi-wrap/issues" }, "license": { "type": "MIT", "url": "https://github.com/jonschlinkert/ansi-wrap/blob/master/LICENSE" }, "files": [ "index.js" ], "main": "index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "test": "mocha" }, "dependencies": {}, "devDependencies": {}, "keywords": [] }package/README.md000644 000765 000024 0000005575 12527504656012036 0ustar00000000 000000 # ansi-wrap [![NPM version](https://badge.fury.io/js/ansi-wrap.svg)](http://badge.fury.io/js/ansi-wrap) > Create ansi colors by passing the open and close codes. ## Install Install with [npm](https://www.npmjs.com/) ```sh $ npm i ansi-wrap --save ``` ## Usage ```js var wrap = require('ansi-wrap'); ``` **Example** Pass codes for [ansi magenta background](https://github.com/jonschlinkert/ansi-bgmagenta): ```js console.log(wrap(45, 49, 'This is a message...')); //=> '\u001b[45mfoo\u001b[49m' ``` Which prints out... [![screen shot 2015-05-21 at 8 28 32 pm](https://cloud.githubusercontent.com/assets/383994/7761769/12488afa-fff8-11e4-9cc1-71a8a6ec14a4.png)](https://www.npmjs.com/) ## Related projects This is used in these projects: * [ansi-reset](https://github.com/jonschlinkert/ansi-reset) * [ansi-bold](https://github.com/jonschlinkert/ansi-bold) * [ansi-dim](https://github.com/jonschlinkert/ansi-dim) * [ansi-italic](https://github.com/jonschlinkert/ansi-italic) * [ansi-underline](https://github.com/jonschlinkert/ansi-underline) * [ansi-inverse](https://github.com/jonschlinkert/ansi-inverse) * [ansi-hidden](https://github.com/jonschlinkert/ansi-hidden) * [ansi-strikethrough](https://github.com/jonschlinkert/ansi-strikethrough) * [ansi-black](https://github.com/jonschlinkert/ansi-black) * [ansi-red](https://github.com/jonschlinkert/ansi-red) * [ansi-green](https://github.com/jonschlinkert/ansi-green) * [ansi-yellow](https://github.com/jonschlinkert/ansi-yellow) * [ansi-blue](https://github.com/jonschlinkert/ansi-blue) * [ansi-magenta](https://github.com/jonschlinkert/ansi-magenta) * [ansi-cyan](https://github.com/jonschlinkert/ansi-cyan) * [ansi-white](https://github.com/jonschlinkert/ansi-white) * [ansi-gray](https://github.com/jonschlinkert/ansi-gray) * [ansi-grey](https://github.com/jonschlinkert/ansi-grey) * [ansi-bgblack](https://github.com/jonschlinkert/ansi-bgblack) * [ansi-bgred](https://github.com/jonschlinkert/ansi-bgred) * [ansi-bggreen](https://github.com/jonschlinkert/ansi-bggreen) * [ansi-bgyellow](https://github.com/jonschlinkert/ansi-bgyellow) * [ansi-bgblue](https://github.com/jonschlinkert/ansi-bgblue) * [ansi-bgmagenta](https://github.com/jonschlinkert/ansi-bgmagenta) * [ansi-bgcyan](https://github.com/jonschlinkert/ansi-bgcyan) * [ansi-bgwhite](https://github.com/jonschlinkert/ansi-bgwhite) ## Running tests Install dev dependencies: ```sh $ npm i -d && npm test ``` ## Contributing Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/ansi-wrap/issues/new) ## Author **Jon Schlinkert** + [github/jonschlinkert](https://github.com/jonschlinkert) + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright © 2015 Jon Schlinkert Released under the MIT license. *** _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on May 21, 2015._package/LICENSE000644 000765 000024 0000002073 12527472277011555 0ustar00000000 000000 The MIT License (MIT) Copyright (c) 2015, Jon Schlinkert. 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 0000000162 12527474161012204 0ustar00000000 000000 'use strict'; module.exports = function(a, b, msg) { return '\u001b['+ a + 'm' + msg + '\u001b[' + b + 'm'; };