apius 0.0.2 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/README.md +24 -1
  2. package/index.js +20 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1 +1,24 @@
1
- # apius-npm-package
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,9 +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
+ }
9
+ },
10
+
11
+ logRGB: (str, rgb, bold = false) => {
12
+ if(bold == false) {
13
+ const requestRGB = chalk.rgb(...rgb)
14
+ return console.log(requestRGB(str))
15
+ } else if(bold == true) {
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))
8
26
  }
9
27
  }
10
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apius",
3
- "version": "0.0.2",
3
+ "version": "0.0.5",
4
4
  "description": "A simple package.",
5
5
  "main": "index.js",
6
6
  "type": "module",