Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hexu

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexu - npm Package Compare versions

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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc