|
| 1 | +<p align="center">An easy to use, powerful and multi-functionality tools-kit library for NodeJS written entirely in JavaScript.</p> |
| 2 | + |
| 3 | +<p align="center"> |
| 4 | + <a href="https://www.npmjs.com/package/tools-kit"> |
| 5 | + <img src="https://img.shields.io/npm/v/tools-kit.svg?style=flat-square" alt="npm" /> |
| 6 | + </a> |
| 7 | + <a href="https://github.com/BlackB1RD-Development/tools-kit"> |
| 8 | + <img src="https://img.shields.io/github/release/BlackB1RD-Development/tools-kit.svg?style=flat-square" alt="release" /> |
| 9 | + </a> |
| 10 | + <a href="https://www.npmjs.com/package/tools-kit"> |
| 11 | + <img src="https://img.shields.io/npm/dt/tools-kit.svg?style=flat-square" alt="downloads" /> |
| 12 | + </a> |
| 13 | + <a href="https://www.npmjs.com/package/tools-kit"> |
| 14 | + <img src="https://img.shields.io/node/v/tools-kit.svg?style=flat-square" alt="node" /> |
| 15 | + </a> |
| 16 | + <a href="https://david-dm.org/BlackB1RD-Development/tools-kit"> |
| 17 | + <img src="https://david-dm.org/BlackB1RD-Development/tools-kit.svg?style=flat-square" alt="dependencies" /> |
| 18 | + </a> |
| 19 | + <a href="https://github.com/BlackB1RD-Development/tools-kit/blob/master/LICENSE"> |
| 20 | + <img src="https://img.shields.io/npm/l/tools-kit.svg?style=flat-square" alt="license" /> |
| 21 | + </a> |
| 22 | + <a href="https://coveralls.io/github/BlackB1RD-Development/tools-kit?branch=master"> |
| 23 | + <img src="https://coveralls.io/repos/github/BlackB1RD-Development/tools-kit/badge.svg?branch=master" alt="Coverage Status" /> |
| 24 | + </a> |
| 25 | + <a href="https://travis-ci.org/BlackB1RD-Development/tools-kit"> |
| 26 | + <img src="https://travis-ci.org/BlackB1RD-Development/tools-kit.svg?branch=master" alt="Build" /> |
| 27 | + </a> |
| 28 | + <a href="https://github.com/BlackB1RD-Development/tools-kit"> |
| 29 | + <img src="https://img.shields.io/badge/code_style-XO-5ed9c7.svg" alt="Code Style" /> |
| 30 | + </a> |
| 31 | + <br /> |
| 32 | + <sub>© <a href="https://www.npmjs.com/package/tools-kit">Tools-Kit</a> By <a href="https://github.com/BlackB1RD-Development">BlackB1RD-Development</a> (<b><a href="https://github.com/RealBlackB1RD">@RealBlackB1RD</a></b>). All rights reserved ©</sub> |
| 33 | +</p> |
| 34 | + |
| 35 | +## Features |
| 36 | +- A Hastebin Client that can publish your beautiful code online or fetching an existing one. |
| 37 | +- A Logger Manager that can style your logs with all the known Node.js console methods. |
| 38 | +- A Color Manager that can style your text in all the possible ways. |
| 39 | +- Easy to use and useful utilities that everyone use 😉 |
| 40 | +- Extremely configurable and debuggable. |
| 41 | +- Well documented. |
| 42 | + |
| 43 | +## Installation |
| 44 | +```console |
| 45 | +npm i tools-kit |
| 46 | +``` |
| 47 | + |
| 48 | +## Tools-Kit Hastebin Client |
| 49 | +With Tools-Kit Hastebin Client you can post and fetch code easily from [**Hastebin**][hastebin]. |
| 50 | +```javascript |
| 51 | +const tools = require('tools-kit'); |
| 52 | + |
| 53 | +const hastebin = tools.hastebin; |
| 54 | +const logger = tools.logger; |
| 55 | + |
| 56 | +hastebin.post('var test = "test";\n\nconsole.log(test);', '.js') |
| 57 | + .then(postRes => { |
| 58 | + logger.log({ tag: 'POST RES' }, postRes); |
| 59 | + |
| 60 | + hastebin.get(postRes.link) |
| 61 | + .then(getRes => logger.log({ tag: 'GET RES' }, getRes)) |
| 62 | + .catch(getErr => logger.error({ tag: 'GET ERROR' }, getErr)); |
| 63 | + }) |
| 64 | + .catch(postErr => logger.error({ tag: 'POST ERROR' }, postErr)); |
| 65 | +``` |
| 66 | + |
| 67 | +## Tools-Kit Logger Manager |
| 68 | +With Tools-Kit Logger Manager you can log a styled and colored text into the console. |
| 69 | +```javascript |
| 70 | +const tools = require('tools-kit'); |
| 71 | + |
| 72 | +const logger = tools.logger; |
| 73 | + |
| 74 | +logger.log('content'); // This will log the content to the console with the stock console settings. |
| 75 | +``` |
| 76 | +Settings custom styling options: |
| 77 | +```javascript |
| 78 | +const tools = require('tools-kit'); |
| 79 | + |
| 80 | +const logger = tools.logger; |
| 81 | +const settings = { |
| 82 | + background: 'blue', |
| 83 | + color: 'red', |
| 84 | + style: 'bold', |
| 85 | + type: 'info', |
| 86 | + time: true, |
| 87 | + tag: 'Red & Blue' |
| 88 | +}; |
| 89 | + |
| 90 | +logger.log(settings, 'content'); // Resulting in a blue background, red colored text, and bold styled text: [20/01/2020 - 00:00:00 | Red & Blue]: content |
| 91 | + |
| 92 | +const options = { |
| 93 | + time: 'MM-DD-YY', |
| 94 | + tag: 'Custom Time Format' |
| 95 | +}; |
| 96 | + |
| 97 | +logger.log(options, 'content'); // Results: [01/20/2020 | Custom Time Format]: content |
| 98 | +``` |
| 99 | + |
| 100 | +## Tools-Kit Color Manager |
| 101 | +With Tools-Kit Color Manager you can transfer your simple text into a styled and modern one. |
| 102 | +```javascript |
| 103 | +const tools = require('tools-kit'); |
| 104 | + |
| 105 | +const color = tools.color; |
| 106 | +const logger = tools.logger; |
| 107 | + |
| 108 | +logger.log({ tag: 'STYLE' }, color.style({ background: 'gray' }, 'styled-background'), 'normal background'); |
| 109 | +logger.log({ tag: 'STYLE' }, color.style({ color: 'red' }, 'styled-color'), 'normal color'); |
| 110 | +logger.log({ tag: 'STYLE' }, color.style({ style: 'bold' }, 'styled-style'), 'normal style'); |
| 111 | +``` |
| 112 | +Using premade cool colors maps: |
| 113 | +```javascript |
| 114 | +const tools = require('tools-kit'); |
| 115 | + |
| 116 | +const color = tools.color; |
| 117 | +const logger = tools.logger; |
| 118 | + |
| 119 | +logger.log({ tag: 'RAINBOW' }, color.rainbow('rainbow colored-text'), 'normal text'); |
| 120 | +logger.log({ tag: 'RANDOM' }, color.random('random colored-text'), 'normal text'); |
| 121 | +logger.log({ tag: 'ZABRA' }, color.zabra('zabra colored-text'), 'normal text'); |
| 122 | +``` |
| 123 | + |
| 124 | +## Tools-Kit Utilities |
| 125 | +With Tools-Kit Utilities you can use the functions that everyone uses in one simple line. |
| 126 | +```javascript |
| 127 | +const tools = require('tools-kit'); |
| 128 | + |
| 129 | +const util = tools.util; |
| 130 | +const logger = tools.logger; |
| 131 | + |
| 132 | +logger.log({ tag: 'OBJECT?' }, util.isObject( new Array)); // false |
| 133 | +logger.log({ tag: 'OBJECT?' }, util.isObject( new Object)); // true |
| 134 | +logger.log({ tag: 'OBJECT?' }, util.isObject( [])); // false |
| 135 | +logger.log({ tag: 'OBJECT?' }, util.isObject( {})); // true |
| 136 | +logger.log({ tag: 'RANDOM ITEM' }, util.randomItem([1, 2, 3, 4])); // 3 |
| 137 | +logger.log({ tag: 'RANDOM NUMBER' }, util.randomNumber( 5, 10)); // 7 |
| 138 | +``` |
| 139 | + |
| 140 | +## Changelog |
| 141 | +See the [**Changes Log**][changelog] for more information about each update. |
| 142 | + |
| 143 | +## Documentation |
| 144 | +Read the [**Documentations**][documentations] for more information about each method. |
| 145 | + |
| 146 | +## License |
| 147 | +[**MIT**][license] |
| 148 | + |
| 149 | +## Related Modules |
| 150 | +- [node-fetch][node-fetch] — A light-weight module that brings window.fetch to Node.js. |
| 151 | +- [moment][moment] — A lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates. |
| 152 | +- [figlet][figlet] — Creates ASCII Art from text. A full implementation of the FIGfont spec. |
| 153 | + |
| 154 | +[hastebin]:https://hastebin.com/about.md |
| 155 | +[documentations]:https://tools-kit.js.org/docs |
| 156 | +[changelog]:https://github.com/BlackB1RD-Development/tools-kit/blob/master/CHANGELOG.md |
| 157 | +[license]:https://github.com/BlackB1RD-Development/tools-kit/blob/master/LICENSE.md |
| 158 | +[node-fetch]: https://www.npmjs.com/package/node-fetch |
| 159 | +[moment]: https://www.npmjs.com/package/moment |
| 160 | +[figlet]: https://www.npmjs.com/package/figlet |
0 commit comments