Skip to content

Conversation

r3mi
Copy link

@r3mi r3mi commented Mar 23, 2017

currently there is no way to force that lines are printed in a given order.
Specifically, Object.keys does not guarantee that keys are returned in insertion order (for example, on chrome and node, keys with numeric names e.g. '0' are returned first and in sort order).
This patch add a 'keys' option to force ordering

var data = {
  ferrets: 20,
  cats: 12,
  dogs: 30,
  koalas: 3
};
console.log(bars(data, { keys: ['cats', 'dogs', 'ferrets'] }));

@r3mi
Copy link
Author

r3mi commented Mar 23, 2017

PS : should I push this patch here, or on https://github.com/ben-ng/bars from @ben-ng , which is the source of the NPM package ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant