apius 0.0.3 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/index.js +15 -4
- 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!", [rgb code], true)
|
21
|
+
|
22
|
+
// - Also you can use hex codes!
|
23
|
+
apius.logHex("hello world!", "hex code") // its can be bold. apius.logHex("hello world!", "hex code", true)
|
24
|
+
```
|
package/index.js
CHANGED
@@ -2,16 +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
|
logRGB: (str, rgb, bold = false) => {
|
11
12
|
if(bold == false) {
|
12
|
-
|
13
|
+
const requestRGB = chalk.rgb(...rgb)
|
14
|
+
return console.log(requestRGB(str))
|
13
15
|
} else if(bold == true) {
|
14
|
-
console.log(chalk.rgb(rgb).bold(str))
|
16
|
+
return console.log(chalk.rgb(...rgb).bold(str))
|
17
|
+
}
|
18
|
+
},
|
19
|
+
|
20
|
+
logHex: (str, hexCode, bold = false) => {
|
21
|
+
if(bold == false) {
|
22
|
+
const requestHex = chalk.hex(hexCode)
|
23
|
+
return console.log(requestHex(str))
|
24
|
+
} else if(bold == true) {
|
25
|
+
return console.log(chalk.hex(hexCode).bold(str))
|
15
26
|
}
|
16
27
|
}
|
17
28
|
}
|