Skip to content

Commit 200d434

Browse files
committed
1.0.0
First release
0 parents  commit 200d434

19 files changed

Lines changed: 5692 additions & 0 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is currently empty

LICENSE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
MIT License
2+
3+
Copyright 2019 Daniel Ohayon
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9+
of the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17+
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
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

examples/ColorManager.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const tools = require('../index.js');
2+
3+
const color = tools.color;
4+
const logger = tools.logger;
5+
6+
logger.log({ tag: 'STYLE' }, color.style({ background: 'gray' }, 'styled-background'), 'normal background');
7+
logger.log({ tag: 'STYLE' }, color.style({ color: 'red' }, 'styled-color'), 'normal color');
8+
logger.log({ tag: 'STYLE' }, color.style({ style: 'bold' }, 'styled-style'), 'normal style');
9+
logger.log({ tag: 'RAINBOW' }, color.rainbow('rainbow colored-text'), 'normal text');
10+
logger.log({ tag: 'RANDOM' }, color.random('random colored-text'), 'normal text');
11+
logger.log({ tag: 'ZABRA' }, color.zabra('zabra colored-text'), 'normal text');

examples/HastebinClient.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const tools = require('../index.js');
2+
3+
const hastebin = tools.hastebin;
4+
const logger = tools.logger;
5+
6+
hastebin.post('var test = "test";\n\nconsole.log(test);', '.js')
7+
.then(postRes => {
8+
logger.log({ tag: 'POST RES' }, postRes);
9+
10+
hastebin.get(postRes.link)
11+
.then(getRes => logger.log({ tag: 'GET RES' }, getRes))
12+
.catch(getErr => logger.error({ tag: 'GET ERROR' }, getErr));
13+
})
14+
.catch(postErr => logger.error({ tag: 'POST ERROR' }, postErr));

examples/LoggerManager.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const tools = require('../index.js');
2+
3+
const logger = tools.logger;
4+
const settings = {
5+
background: 'blue',
6+
color: 'red',
7+
style: 'bold',
8+
type: 'info',
9+
time: true,
10+
tag: 'Red & Blue'
11+
};
12+
13+
logger.log('content'); // This will log the content to the console with the stock console settings.
14+
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
15+
16+
const options = {
17+
time: 'MM-DD-YY',
18+
tag: 'Custom Time Format'
19+
};
20+
21+
logger.log(options, 'content'); // Results: [01/20/2020 | Custom Time Format]: content

examples/UtilUtilities.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const tools = require('../index.js');
2+
3+
const util = tools.util;
4+
const logger = tools.logger;
5+
6+
logger.log({ tag: 'OBJECT?' }, util.isObject( new Array)); // false
7+
logger.log({ tag: 'OBJECT?' }, util.isObject( new Object)); // true
8+
logger.log({ tag: 'OBJECT?' }, util.isObject( [])); // false
9+
logger.log({ tag: 'OBJECT?' }, util.isObject( {})); // true
10+
logger.log({ tag: 'RANDOM ITEM' }, util.randomItem([1, 2, 3, 4])); // 3
11+
logger.log({ tag: 'RANDOM NUMBER' }, util.randomNumber( 5, 10)); // 7

index.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// tools-kit 1.0.0
2+
// Project: https://github.com/BlackB1RD-Development/tools-kit
3+
// License: MIT
4+
5+
// Requires
6+
const packageJSON = require('./package.json');
7+
const Hastebin = require('./lib/Clients/Hastebin.js');
8+
const Logger = require('./lib/Managers/Logger.js');
9+
const Color = require('./lib/Managers/Color.js');
10+
const Util = require('./lib/Utilities/Util.js');
11+
12+
/**
13+
* The Tools-Kit package
14+
*/
15+
class Kit {
16+
/**
17+
* The package version
18+
* @returns {String} The package version
19+
* @readonly
20+
*/
21+
static get pVersion() {
22+
return packageJSON.version;
23+
}
24+
25+
/**
26+
* The package name
27+
* @returns {String} The package name
28+
* @readonly
29+
*/
30+
static get pName() {
31+
return packageJSON.name;
32+
}
33+
}
34+
35+
Kit.version = Kit.pVersion;
36+
Kit.name = Kit.pName;
37+
38+
Kit.util = Util;
39+
Kit.color = Color;
40+
Kit.logger = Logger;
41+
Kit.hastebin = Hastebin;
42+
43+
module.exports = Kit;

0 commit comments

Comments
 (0)