parr
v0.0.0
Published
Turn an array into a string for easier, more versatile, printing and debugging
Downloads
5
Maintainers
Readme
npm module to turn an array into a string for easier, more versatile, printing and debugging
Install
$ npm install --save parr
Usage
const parr = require('parr');
console.log(parr([1, 2, [3, 4, [5, 6], 7], [8, 9]], ['v', 'b', 't']));
//=> [
//=> number,
//=> number,
//=> [
//=> number,
//=> [
//=> number,
//=> number
//=> ],
//=> number
//=> ],
//=> [
//=> number,
//=> number
//=> ]
//=> ]
console.log(parr([1, 2, [3, 4, [5, 6], 7], [8, 9]], ['b', 't']));
//=> [ number, number, [ number, [ number, number ], number ], [ number, number ] ]
console.log(parr([1, 2, [3, 4, [5, 6], 7], [8, 9]]));
//=> 1, 2, 3, 4, 5, 6, 7, 8
API
parr(array, flags)
array
Type: Array
flags
Type: Array
v --> print array vertically b --> print brackets t --> print type of inner values
Turn an into a string for easier, more versatile, printing and debugging
Coming Updates
As it stands now it does not have support for anything other than arrays so it cannot handle objects in arrays. That will change.
There will also be some major logic changes as to how to prints
License
MIT © Alex Brelsford