Comparing version 0.1.0 to 1.0.0
33
index.js
@@ -1,20 +0,17 @@ | ||
/* | ||
* Hexu V0.1.0 | ||
* Copyright 2016, Kabir Shah | ||
* https://github.com/KingPixil/hexa.git | ||
* Free to use under the MIT license. | ||
* http://spdx.org/licenses/MIT | ||
*/ | ||
"use strict"; | ||
const util = require('util') | ||
function colorize (color, text) { | ||
const codes = util.inspect.colors[color] | ||
return `\x1b[${codes[0]}m${text}\x1b[${codes[1]}m` | ||
} | ||
/** | ||
* Get a random HEX color | ||
* | ||
* @param {String} html | ||
* @return {String} | ||
*/ | ||
module.exports = { | ||
hexu: function() { | ||
return '#' + Math.random().toString(16).slice(2, 8); | ||
} | ||
}; | ||
function hexu () { | ||
let returnValue = {} | ||
Object.keys(util.inspect.colors).forEach((color) => { | ||
returnValue[color] = (text) => colorize(color, text) | ||
}) | ||
return returnValue | ||
} | ||
module.exports = hexu() |
{ | ||
"name": "hexu", | ||
"version": "0.1.0", | ||
"description": "A small library can generate a random hex color", | ||
"version": "1.0.0", | ||
"description": "make your logs colorful", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo No Test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/KingPixil/hexu.git" | ||
}, | ||
"keywords": [ | ||
"hexa", | ||
"random hex color", | ||
"hex color" | ||
], | ||
"author": "Kabir Shah <simplecooldude1@gmail.com> (http://kingpixil.github.io/Me/)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/KingPixil/hexu/issues" | ||
} | ||
"author": "Kabir Shah", | ||
"license": "MIT" | ||
} |
# hexu | ||
An NPM module to generate random HEX colors | ||
# Usage | ||
add colors to your logs | ||
* First of all, install the module: | ||
### Usage | ||
use like this: | ||
```js | ||
var hexu = require('hexu'); | ||
console.log(hexu.green('Hello Hexu')); // prints in green color | ||
``` | ||
npm install hexu | ||
``` | ||
* Require and define the hexa() function | ||
``` | ||
var hexa = require('hexu').hexu; | ||
``` | ||
* Use the hexu() function! | ||
``` | ||
foo.color = hexu() | ||
``` | ||
works with common colors | ||
### License | ||
licensed under the [MIT License](http://kingpixil.github.io/license) by [Kabir Shah](http://kabir.ml) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
19
926
3
14
2
1