1.0.2 • Published 9 years ago

burger-toolkit v1.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
9 years ago

Install With


npm install burger-toolkit --save

Read This


burger-toolkit on NPM

burger-toolkit is a useful tool that I use when it comes to certain things, for example:

color.js, the library burger-toolkit uses for coloring text can do this:

console.log('someString'.green) and will output "someString" in green.

or console.log(colors.green('someString'))

BUT, if you want to pass the color, background and or styling from the end-user to the program, you will need to do something like this:

if(color === "black") console.log("someString".black) for every possible color that you might want to support, but burger-toolkit allows you to do:

console.log(burger.colorString("someString", "black")) or

console.log(burger.colorString("someString", burger.c(0))) depending on your use,

this allows you to pass any color, background, or styling information as a string or integer

burger.c(int) will return a color depending on the integer you give it. burger.c(0) returns "black"

Also, there are similar functions for styling and background:

console.log(burger.colorStringBG("someString", "black")

console.log(burger.styleString("someString", "bold")

(string only for styling)

Other Features


burger.log("log.txt", "append this to end of log.txt")

burger.logArray("log.txt", array)

burger.logArray("log.txt", array, "red", "black")

The last one will log each element in array with a certain color and background.

Useful Information


burger.strip("someString") will strip any string of it's ANSI color information using strip-ansi

Numbers and strings:

"black" or 0

"red" or 1

"green" or 2

"yellow" or 3

"blue" or 4

"magenta" or 5

"cyan" or 6

"white" or 7

"gray" or 8

"grey" or 9

you can use burger.c(int) for burger.colorString(string, color)

or burger.colorStringBG(string, bgColor)

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.21

10 years ago

0.0.20

10 years ago

0.0.19

10 years ago

0.0.18

10 years ago

0.0.17

10 years ago

0.0.16

10 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago