apius 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +24 -1
- package/index.js +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1 +1,24 @@
|
|
1
|
-
#
|
1
|
+
# Apius
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
> `npm i apius`
|
6
|
+
|
7
|
+
## Introduction
|
8
|
+
|
9
|
+
> A helpful package for node projects.
|
10
|
+
|
11
|
+
## Code Samples
|
12
|
+
|
13
|
+
```js
|
14
|
+
import apius from 'apius'
|
15
|
+
|
16
|
+
// - You can send colored log message!
|
17
|
+
apius.log("hello world!", "color") // its can be bold. apius.log("hello world!", "color", true)
|
18
|
+
|
19
|
+
// - And you can use RGB codes!
|
20
|
+
apius.logRGB("hello world!", [rgb code]) // its can be bold. apius.log("hello world!", "color", true)
|
21
|
+
|
22
|
+
// - Also you can use hex codes!
|
23
|
+
apius.logHex("hello world!", "hex code") // its can be bold. apius.logHex("hello world!", "color", true)
|
24
|
+
```
|
package/index.js
CHANGED
@@ -2,27 +2,27 @@ import chalk from 'chalk'
|
|
2
2
|
export default {
|
3
3
|
log: (str, color, bold = false) => {
|
4
4
|
if(bold == false) {
|
5
|
-
console.log(chalk[color](str))
|
5
|
+
return console.log(chalk[color](str))
|
6
6
|
} else if(bold == true) {
|
7
|
-
console.log(chalk[color].bold(str))
|
7
|
+
return console.log(chalk[color].bold(str))
|
8
8
|
}
|
9
9
|
},
|
10
10
|
|
11
11
|
logRGB: (str, rgb, bold = false) => {
|
12
12
|
if(bold == false) {
|
13
|
-
const
|
14
|
-
console.log(
|
13
|
+
const requestRGB = chalk.rgb(...rgb)
|
14
|
+
return console.log(requestRGB(str))
|
15
15
|
} else if(bold == true) {
|
16
|
-
console.log(chalk.rgb(rgb).bold(str))
|
16
|
+
return console.log(chalk.rgb(...rgb).bold(str))
|
17
17
|
}
|
18
18
|
},
|
19
19
|
|
20
20
|
logHex: (str, hexCode, bold = false) => {
|
21
21
|
if(bold == false) {
|
22
|
-
const
|
23
|
-
console.log(
|
22
|
+
const requestHex = chalk.hex(hexCode)
|
23
|
+
return console.log(requestHex(str))
|
24
24
|
} else if(bold == true) {
|
25
|
-
console.log(chalk.hex(hexCode).bold(str))
|
25
|
+
return console.log(chalk.hex(hexCode).bold(str))
|
26
26
|
}
|
27
27
|
}
|
28
28
|
}
|