Skip to content
No description, website, or topics provided.
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demos
src
test
.eslintrc.js
.gitignore
LICENSE
README.md
\
index.js
package-lock.json
package.json

README.md

                                      
    ,...                              
  .d' ""                              
  dM`                                 
 mMMmm,pW"Wq.`7M'   `MF'`7M'   `MF'   
  MM 6W'   `Wb `VA ,V'    VA   ,V     
  MM 8M     M8   XMX       VA ,V      
  MM YA.   ,A9 ,V' VA.      VVV       
.JMML.`Ybmd9'.AM.   .MA.    ,V        
                           ,V         
                        OOb"          
                                      
       ,,                             
     `7MM                             
       MM                             
  ,M""bMM  .gP"Ya `7M'   `MF'         
,AP    MM ,M'   Yb  VA   ,V           
8MI    MM 8M""""""   VA ,V            
`Mb    MM YM.    ,    VVV             
 `Wbmd"MML.`Mbmmd'     W              
                                      
                                      
                                      
                          ,,          
  mm                    `7MM          
  MM                      MM          
mmMMmm ,pW"Wq.   ,pW"Wq.  MM  ,pP"Ybd 
  MM  6W'   `Wb 6W'   `Wb MM  8I   `" 
  MM  8M     M8 8M     M8 MM  `YMMMa. 
  MM  YA.   ,A9 YA.   ,A9 MM  L.   I8 
  `Mbmo`Ybmd9'   `Ybmd9'.JMML.M9mmmP' 
                                      
                                      

foxy dev tools is a dev tool for the Node.js environment.

Setup

npm install foxy-dev-tools --save-dev

Usage

Please consider the examples in the demos folder.

Pretty-print objects

demos/demo-logObj.js

demo1

Input an object. The object will be pretty-printed in a tree-like maner, with each value categorized by type.

const randomObject = {
	someObject: {
		someNumber: 1,
		anArray: [ 'a', 'b', 'c'],
		anotherObject: {
			randomKey: 1900
		}
	},
	someString: 'Another string',
	fo: function bar () {
		console.log('foo bar');
	}    
};
logObj(randomObject);

Boxify

demos/demo-boxify.js

demo2

Boxify return a boxified text. You can combine this with the print function or with process.stdout.write, console.log or another function.

const someText = `Hello,
World!`;
const boxifiedText = boxify(someText);
boxifiedText.forEach((ln) => print(ln, 'black', 'white'));

Menus

demos/demo-menu.js

demo5

Takes an array of menu-items and a callback function that will as its argument recieve an object with the index of the menu item choosen, as well as the value.

const menuOptions = ['do this', 'do that', 'exit'];

menu(menuOptions, select);

function select (menuItem) {
	print (menuItem.option, 'purple');
	process.exit(0);
} 

Colorized text

demos/demo-print.js

demo4

Prints text. You can set foreground and background color (and also make the text bold).

print('foo bar', 'blue', 'white', 'bold')

lines

Returns a line, defaulted to console line width with '=' as character. Both attributes can be overwritten.

const line = hr(20, '~');
print (line, 'cyan');

mark

demos/demo-mark.js

demo3

Marks a value in the standard output (different background color, surrounded by lines).

const someValue = {
    someKey: 'Hello, World!'
};
mark (someValue)

Features

  • foxy-print JavaScript objects in a Node.js environment

  • boxed text

  • lines

  • simple menus

  • clear screen

  • print text with color

  • csv-tables

  • mark values in standard output

  • highlight value

  • highlight key

You can’t perform that action at this time.