Comparing version 1.0.1 to 1.0.2
18
index.js
@@ -11,19 +11,11 @@ /* | ||
var util = require('util'); | ||
const util = require("util"); | ||
/* ANSI escape codes to standard output using node.js util module | ||
* | ||
* https://nodejs.org/api/util.html#util_customizing_util_inspect_colors | ||
* https://en.wikipedia.org/wiki/ANSI_escape_code#Example_of_use_in_shell_scripting | ||
*/ | ||
function mix(color, spec) { | ||
var aec = util.inspect.colors[color]; | ||
return "\u001b[" + aec[0] + "m" + spec + "\u001b[" + aec[1] + "m"; | ||
const style = util.inspect.colors[color]; | ||
return `\u001b[${style[0]}m${spec}\u001b[${style[1]}m`; | ||
} | ||
// Rangi function | ||
function rangi() { | ||
var returnValue = {}; | ||
const returnValue = {}; | ||
Object.keys(util.inspect.colors).forEach(function (color) { | ||
@@ -37,2 +29,2 @@ returnValue[color] = function (spec) { | ||
module.exports = rangi(); | ||
module.exports = rangi(); |
{ | ||
"name": "rangi", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A Dead Simple Terminal Color Module", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
@@ -10,0 +7,0 @@ "type": "git", |
[![](https://img.shields.io/npm/dt/rangi.svg?style=flat-square)](https://www.npmjs.com/package/rangi) | ||
[![https://telegram.me/kamikazechaser](https://img.shields.io/badge/%F0%9F%92%AC_Telegram-kamikazechaser-blue.svg?style=flat-square)](https://telegram.me/kamikazechaser) | ||
[![https://github.com/kamikazechaser/rangi/blob/master/LICENSE.md](https://img.shields.io/badge/license-MIT-lightgreen.svg?style=flat-square)](https://github.com/kamikazechaser/rangi/blob/master/LICENSE.md) | ||
[![https://github.com/kamikazechaser/rangi/blob/master/LICENSE.md](https://img.shields.io/badge/license-MIT-lightgreen.svg?style=flat-square)](https://github.com/kamikazechaser/rangi/blob/master/LICENSE) | ||
> 🎨 Rangi | ||
@@ -10,2 +10,6 @@ | ||
## Demo | ||
![rangi](http://i.imgur.com/WKUyo3a.png "Rangi") | ||
## Install | ||
@@ -19,5 +23,9 @@ | ||
```javascript | ||
var rangi = require('rangi'); | ||
const rangi = require("rangi"); | ||
console.log(rangi.cyan('Hello World!')); | ||
// color styling | ||
console.log(rangi.cyan("Hello World! This text is cyan in color!")); | ||
// text formatting | ||
console.log(rangi.bold("Hello World! This text is bold in style!")); | ||
``` | ||
@@ -37,2 +45,8 @@ | ||
## Supported Text Styles | ||
- `Bold` | ||
- `Italic` | ||
- `Underline` | ||
- `Inverse` - _Inverted black and white text only_ | ||
@@ -44,8 +58,2 @@ ## Supported Shells | ||
- `X-Term` | ||
## Example | ||
![alt text](http://i.cubeupload.com/GAyb4n.jpg "Example") | ||
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
0
55
4148
23