{"id":13757706,"url":"https://github.com/fliphub/fliplog","last_synced_at":"2025-08-22T02:30:44.808Z","repository":{"id":57238475,"uuid":"86541776","full_name":"fliphub/fliplog","owner":"fliphub","description":"fluent logging with verbose insight, colors, tables, emoji, filtering, spinners, progress bars, timestamps, capturing, stack traces, tracking, presets, \u0026 more...","archived":false,"fork":false,"pushed_at":"2017-06-14T23:18:44.000Z","size":4041,"stargazers_count":44,"open_issues_count":11,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-19T15:51:22.812Z","etag":null,"topics":["capture","chainable","cli","cli-color","color","debug","emoji","fluent","log","logging","presets","progress","progress-bars","spinner","stack-traces","tables","timestamp","trace","verbose"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fliphub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-29T05:27:41.000Z","updated_at":"2022-03-17T09:36:59.000Z","dependencies_parsed_at":"2022-08-26T14:07:17.524Z","dependency_job_id":null,"html_url":"https://github.com/fliphub/fliplog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fliphub%2Ffliplog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fliphub%2Ffliplog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fliphub%2Ffliplog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fliphub%2Ffliplog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fliphub","download_url":"https://codeload.github.com/fliphub/fliplog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230547682,"owners_count":18243227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capture","chainable","cli","cli-color","color","debug","emoji","fluent","log","logging","presets","progress","progress-bars","spinner","stack-traces","tables","timestamp","trace","verbose"],"created_at":"2024-08-03T12:00:45.940Z","updated_at":"2024-12-20T07:07:32.230Z","avatar_url":"https://github.com/fliphub.png","language":"JavaScript","funding_links":[],"categories":["NodeJS"],"sub_categories":[],"readme":"# ⛓🔈 fliplog\n\n[![NPM version][fliplog-npm-image]][fliplog-npm-url]\n[![MIT License][license-image]][license-url]\n[![fliphub][gitter-badge]][gitter-url]\n[![flipfam][flipfam-image]][flipfam-url]\n\n[fliplog-npm-image]: https://img.shields.io/npm/v/fliplog.svg\n[fliplog-npm-url]: https://npmjs.org/package/fliplog\n[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license-url]: https://spdx.org/licenses/MIT\n[gitter-badge]: https://img.shields.io/gitter/room/fliphub/pink.svg\n[gitter-url]: https://gitter.im/fliphub/Lobby\n[flipfam-image]: https://img.shields.io/badge/%F0%9F%8F%97%20%F0%9F%92%A0-flipfam-9659F7.svg\n[flipfam-url]: https://www.npmjs.com/package/flipfam\n\n\u003e all-in-one logging tool\n\n![Screenshot](https://cloud.githubusercontent.com/assets/4022631/24160506/46c47d34-0e1f-11e7-8c27-4b653330ae02.png)\n\n[deep-diff]: https://www.npmjs.com/package/deep-diff\n[fmtobj]: https://github.com/queckezz/fmt-obj\n[sprintf]: https://github.com/alexei/sprintf.js\n[prettyformat]: https://github.com/facebook/jest/tree/master/packages/pretty-format\n[ava-prettyformat]: https://github.com/avajs/pretty-format\n[jest-diff]: https://github.com/facebook/jest\n[diff-match-patch]: https://code.google.com/archive/p/google-diff-match-patch/\n[code-prettify]: https://github.com/google/code-prettify\n[chain-able]: https://github.com/fluents/chain-able\n[ansi]: https://github.com/TooTallNate/ansi.js\n[prettysize]: https://github.com/davglass/prettysize\n[listr]: https://github.com/samverschueren/listr\n[treeify]: https://github.com/notatestuser/treeify\n[js-traverse]: https://github.com/substack/js-traverse\n[ava-format]:https://github.com/avajs/ava  \n\n## usage\n```bash\nyarn add fliplog\nnpm i fliplog --save\n```\n\n```js\nconst log = require('fliplog')\n```\n\n## 🔠 description\n\nfluent logging with verbose insight, colors, tables, emoji, deep cleaning, filtering, spinners, progress bars, timestamps, capturing, stack traces, clearing, boxen, stringifying, code highlighting, notifications, beeping, sparkles, slow-mode, formatting, bar charts, \u0026 presets\n\n## 🗝️ legend:\n- [👋 basics](#-basics)\n- [🎀 stringifying](#-stringifying)\n  - [json](#json)\n  - [stringify](#stringify)\n- [🙊 silencing](#-silencing)\n  - [capture all](#capture-all)\n  - [return formatted values](#return)\n  - [return values](#return)\n- [🎨 color](#-color)\n  - [chalk](#chalk)\n  - [shorthands](#shorthands)\n  - [xterm](#xterm)\n- [function](#function)\n- [😊 emoji](#-emoji)\n- [☕ filtering](#-filtering)\n  - [🔢 level](#-level)\n  - [🎯 matcher](#-matcher)\n  - [🚩 flags](#tags)\n  - [filter](#filter--tags)\n  - [tags](#filter--tags)\n- [🛑 quick](#-quick)\n- [⬛ table](#-tables)\n- [🛁 cleaner](#-cleaner)\n- [⚖️ diff](https://github.com/fliphub/fliplog/blob/master/README.md#️-diff)\n- [🌀 spinner](#-spinner)\n  - [multi](#-spinner)\n  - [ora](#-spinner)\n- [📈 progress](#-progress)\n- [🛎 notify](#-notify)\n- [🗺 stack traces](#-stack-traces)\n- [🔎 finding logs](#-find-logs)\n- [⚾ catch errors](#-catch-errors)\n- [®️ .register](https://github.com/fliphub/fliplog#️-register)\n- [trace](#trace)\n- [🆑 clear](#-clear)\n- [🕳 deep](#-deep)\n  - [verbose vs tosource](#vs)\n  - [verbose](#verbose)\n  - [tosource](#tosource)\n- [💈 highlight](#-highlight)\n- [🍰 presets](#-presets)\n  - [add your own](#add-your-own)\n  - [use built ins](#use-built-ins)\n- [⌛ timestamps](#-timestamps)\n- [from](#from)\n- [🎢 fun](#-fun)\n  - [🌲 tree](#-tree)\n  - [📊 bar chart](#-bar)\n  - [📦 box](#-box)\n  - [📯 beep](#-beep)\n  - [🎇 sparkly](#-sparkly)\n  - [🔣 formatting](#-formatting)\n    - [🛰 space](#-space)\n    - [💱 formatter](#-formatter)\n  - [🐌 slow](#-slow)\n  - [⏲ timer](#-timer)\n  - [⚡ performance](#-performance) (_lightweight configurable dependencies_)\n- [resources](#-resources)\n\n## 👋 basics\n\n```js\nlog\n  .data({anyKindOfData: true}) // .json, .stringify, .tosource, .verbose\n  .text('text to use, this is what gets colored')\n  .color('bold') // any cli-color, chalk, available as shorthands\n  .echo() // outputs the log, .return to return the formatted values\n```\n\n# 🆕 NEW!\n\n\u003e 📝📚 all of these new ones need more docs\n\n[📖 read the wip docs for new stuff on the wiki](https://github.com/fliphub/fliplog/wiki/new)\n\n### `+` == `.echo`\n\n\n```js\nlog.italic('so short!')+\n\n// ^ same as `log.italic('so short!').echo()`\n```\n\n## 🎀 stringifying\n### json\n\n[prettyjson](https://www.npmjs.com/package/prettyjson)\n\n```js\n// optional second arg for options passed into pretty json\nlog.json({eh: 'prettified'})\n```\n\n### stringify\n\n[javascript-stringify](https://www.npmjs.com/package/javascript-stringify)\n\n```js\n// args are the same as javascript-stringify\nlog.stringify({data: 'can stringify deep things'})\n```\n\n\n## 🙊 silencing\n- to disable outputting a log, `.silence()` (optional `true`/`false` arg)\n- to disable **all** logs, `.shush()`\n- to enable **all** logs, `.unshush()`\n\n### capture all\n\n\u003e capture output of all console logs everywhere\n\n```js\nlog.startCapturing()\n\nconsole.log('this will be captured')\nlog.stopCapturing()\n\n// captured data is available here\nconst saved = log.savedLog\n```\n\n### return\n\nreturn only echos from fliplogs, useful for getting formatted data.\n\n```js\n// formatted data\nconst {text, data} = log\n  .data({catchMeIfYouCan: true})\n  .text('gingerbread man')\n  .returnVals()\n\n// this returns everything inside, it will call .filter first\nconst everything = log\n  .color('blue.underline')\n  .data({canYouHandleIt: true})\n  .text('M')\n  .return()\n```\n\n\n\n\n## 🎨 color\n\n### chalk\n\n![chalks](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)\n\nall [chalk](https://github.com/chalk/chalk) colors available with `.color`\n\n```js\nlog\n.text('\\n========================================\\n')\n.color('bold')\n.echo()\n```\n\n#### shorthands\n```js\nlog\n  .bold('same as calling .color(bold).text(all this text)')\n  .echo()\n```\n\n### xterm\n![cli-colors](https://cloud.githubusercontent.com/assets/4022631/24440335/7edf540c-1408-11e7-8d3b-b460d794f3b0.png)\n\nall [cli-color](https://www.npmjs.com/package/cli-color) are available by calling `.xterm`\n\n```js\nlog\n  .time(true)\n  .xterm(202, 236).text(' orange!!! ')\n  .echo()\n```\n\n\n## function\nbecause it's javascript, the log is an object... but it can be called as a function for convenience\n\n```js\nlog({data: true}, 'text', 'color')\n```\n\nstack\n\n## 😊 emoji\nnames using [emoji-commits](https://github.com/aretecode/emoji-commits) are available with `.emoji` (currently 🚧 not all have been ported yet)\n\n```js\nlog\n  .emoji('phone')\n  .text('et')\n  .data('phone home')\n  .echo()\n```\n\n## ☕ filtering\ncomma separated strings, or arrays\na function can also be passed in, the argument will be an object containing the entries [see `flipchain/ChainedMap.entries`](https://www.npmjs.com/package/flipchain#other)\n\n### 🔢 level\n\nfilter by log level as a number with simple [comparison operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)\n\n```js\nlog.filter('\u003e= 1')\nlog.level(1).bold('above 1... success').echo()\nlog.level(0).bold('not above 1...').echo()\n```\n\n### 🎯 matcher\n\nfilter using an `Array` made up of `Function`s, `String`s, and `RegExp`s!\n\n```js\nlog.filter(['canada*'])\nlog.tag('canada-eh').white('canadian, pass.').echo()\n```\n\nmore advanced\n```js\nlog.filter(['eh*', '!warm', tag =\u003e (/ez/).test(tag)])\nlog.tag('eh').underline('eh').echo()\nlog.tag('warm').red('warm').echo()\nlog.tag('ez').yellow('ez').echo()\n```\n\n\n❗ important to note, if only a function is passed in, it will have the entire log instance passed to the argument, rather than the array of tags (for compatibility \u0026 simplicity.)\n\n\n### filter \u0026 tags\n\n- `verbose` enables everything\n- `silent` silences everything\n- `!` means disabled\n\n```js\nlog\n  .filter('!nope, yes')\n\nlog\n  .tag('unrelated,nope')\n  .cyan('you will never see me :-(')\n  .echo()\n\nlog\n  .tag('yes')\n  .underline('yay!')\n  .echo()\n```\n\n## 🚩 flags\n\nthis can also be done using cli flags [compat with debug flags](https://github.com/fliphub/fliplog/issues/22)\n\n```bash\nyourprogram --DEBUG=\"!nope,yes\"\nyourprogram --DEBUG=verbose\n```\n\n## 🛑 quick\n\nquickly log data and exit if you want to stop execution at a certain point for\ndebugging\n\n```js\nlog.quick({give: 'me'}, 'everything', 'and quit')\n\n// or\nlog.data({now: 'die'}).exit(1)\n```\n\n\n## ⬛ tables\n![Screenshot](http://i.imgur.com/sYq4T.png)\n\nextending [cli-table2](https://github.com/jamestalmage/cli-table2)\n\n```js\nlog\n  .table(['header1', 'header2'], ['row1', 'row2'])\n  .echo()\n\nlog\n  .table(['header1', 'header2'])\n  .row({'key1': 'val1'})\n  .row({'key2': 'val2'})\n  .echo()\n```\n\n## ⚖️ diff\n\n![ava-diff](https://github.com/avajs/ava/raw/master/media/magic-assert-combined.png)\n(_uses a fork of [ava-format][ava-format] which is a fork of [jest-diff][jest-diff] which is a fork of [google's diff-match-patch][diff-match-patch]_)\n\nCompare two pieces of data. Data will be cloned so it can be mutated if needed, and then compared.\n\n```js\nlet oneOneTwoTwo = 'one-one  was a race horse 🐎 '\nlog.diff(oneOneTwoTwo)\nlog.diff(oneOneTwoTwo + '... two-two was one, two.')\nlog.echo()\n```\n\n(_previously [deep-diff][deep-diff] \u0026 cli-table was used._)\n\n```js\nconst royalty = {posh: true}\nconst lowlyPeasant = {pauper: true}\nlog.diff(royalty)\nconst abomination = Object.assign(royalty, lowlyPeasant)\nlog.diff(abomination)\nlog.echo()\n```\n\n## 🛁 cleaner\n\nextremely powerful tool built with [chain-able][chain-able] using a fork of [js-traverse][js-traverse]\n\ncan take next-to-unusable output such as this ![garbage](https://user-images.githubusercontent.com/4022631/27126483-7bd3e21a-50ac-11e7-840a-ea49d3de5176.gif)\n\nand clean it usable\n![cleaned](https://user-images.githubusercontent.com/4022631/27126552-b2a512a0-50ac-11e7-966d-9b92803503f8.png)\n\n...or you could clean out certain phrases from every log\n\n\n```js\nvar obj = {property: {}}\nobj.circularReference = obj\nobj[Symbol('foo')] = 'foo'\nobj.map = new Map()\nobj.map.set('prop', 'value')\nobj.array = [1, NaN, Infinity]\n\nlog.prettyformat(obj).echo()\n\nconst cleaner = log\n  .cleaner(true)\n  .keys([/array|circularReference|map|property/])\n  .data(obj)\n  .clean()\n  .echo()\n```\n\n\n\n## 🌀 spinner\n\n![spinners](https://github.com/sindresorhus/cli-spinners/raw/master/screenshot.gif)\n\n- extends [cli-spinner](https://www.npmjs.com/package/cli-spinner#demo)\n- uses [cli-spinners](https://github.com/sindresorhus/cli-spinners)\n- `.Spinner` is available on fliplog as the instantiated spinner\n\n#### easy\n\n```js\n// easy to color spinners\nlog.bold().startSpinner('loading...')\nsetTimeout(() =\u003e log.stopSpinner(), 2000)\n```\n\n#### advanced\n\n```js\n// instance available on log.Spinner\nlog.startSpinner('spinner message', {\n  // optional spinner args\n  onTick: () =\u003e {},\n\n  // where to output the logs, default process.stdout\n  stream: () =\u003e {}\n\n  // default 60\n  delay: 80,\n})\n\nconsole.log('log this, then spinner shows up again - it is sticky.')\n\nlog.stopSpinner()\n```\n\n### 🌀🌀 multiple\n\n![multi-spinner](https://cloud.githubusercontent.com/assets/4022631/24937229/00228c10-1ee4-11e7-88ae-5c6f626014cb.gif)\n\n- uses [node-multispinner](https://github.com/codekirei/node-multispinner)\n\n\n```js\n// instance available on log.spinners\nlog\n  .addSpinner('key1', 'spinner 1 msg')\n  .addSpinner('key2', 'spinner 2 msg')\n  .addSpinner('key3', 'spinner 3 msg')\n\n  // arg is optionally a string for frames\n  // or an object for multi-spinner options\n  .startSpinners()\n\n// string arg removes by name\nsetTimeout(() =\u003e log.removeSpinner('key1'), 1000)\n\n// empty args removes all\nsetTimeout(() =\u003e log.removeSpinner(), 20000)\n```\n\n\n### ora\n- `.ora` is available as a method with [the same options](https://github.com/sindresorhus/ora)\n- adds `.fliplog` to the `ora` instance to allow chaining back to fliplog\n- returns `ora` instance\n\n```js\n// call .ora\nlog.ora('loading...').start()\n\n// or\nlog.spinner('loading...', {ora: true})\n\n```\n\n\n## 📈 progress\n\n![progress bar](https://cloud.githubusercontent.com/assets/4022631/24585493/9b68fea8-1740-11e7-8b52-d98fa13c9301.gif)\n\n- [node-progress](https://github.com/visionmedia/node-progress)\n\n### default\n```js\nlog.progress()\n```\n\n### interval callback\n\ntotal, cb(bar, interval), interval time\n\n```js\nlog.progress(20, (bar, interval) =\u003e {\n  bar.tick()\n  if (bar.complete) clearInterval(interval)\n}, 1000)\n```\n\n### advanced\n\n![progress bar download](https://cloud.githubusercontent.com/assets/4022631/24585520/376f2264-1741-11e7-8264-f9f85628e44e.gif)\n\n```js\nlet contentLength = 128 * 1024\nconst bar = log.progress('  downloading [:bar] :percent :etas', {\n  complete: '=',\n  incomplete: ' ',\n  width: 20,\n  total: contentLength,\n}).progressBar\n\nfunction next() {\n  if (!contentLength) return\n  bar.tick(Math.random() * 10 * 1024)\n  if (!bar.complete) setTimeout(next, Math.random() * 1000)\n}\nnext()\n```\n\n\n\n## 🛎 notify\n\n![node-notifier](https://raw.githubusercontent.com/mikaelbr/node-notifier/master/example/input-example.gif)\n\n- allows passing in the same options from [node-notifier](https://github.com/mikaelbr/node-notifier)\n\n\n#### string title and [description]\nor a `string` for `title`\n```js\nlog\n  .notify('woot!', 'super long and not as important description')\n  .echo()\n```\n\n#### shorthand (echo immediate)\n```js\nlog.notify('woot!', true)\n```\n\n\n\n\n## 🗺 stack traces\n\n### ⚾ catch errors\n\nwill output the stack trace formatted and inspected deeply with the error preset\n\n```js\nconst ForeverAndEver = new Promise(resolve =\u003e Promise.resolve())\n  .then(() =\u003e Promise.reject('💍'))\n  .catch(log.catch)\n```\n\n### 🔎 find logs\nin your entry point, calling `log.track()` will output the location all of the next logs output from.\n\n```js\nlog.track()\n\n// later on...\n\nlog.bold('I cannot be found... oh wait, I was tracked.').echo()\n```\n\nyou can also track every console.log anywhere\n\n```js\nlog.trackConsole()\n\n// becomes `eh 'at your-file#the-line-number'`\nconsole.log('me!')\n```\n\n### trace\ncalling `.trace` will output a shortened stack trace to the current location.\n```js\nlog.data({bigData: 'oh'}).trace().echo()\n```\n\n## ®️ register\n\n### registerConsole\n\ndefines properties on the `console` global and automatically calls `echo` where applicable, for easier access:\n\n```js\nlog.registerConsole()\n\nconsole.time('so easy')\nconsole.bold('hullabaloo')\nconsole.error(new Error('eh-rar'))\nconsole.timeEnd('so easy')\nconsole.quick('toodaloo')\n\n// also available\n// verbose, info, error, track, trace, note, warning, spinner, time, timeEnd, timeLap timeLapEcho, box, beep, timer, table, diff, diffs, stringify, stack, json, filter, tags, quick, exit, reset, sleep, slow, red, yellow, cyan, underline, magenta, bold\n```\n\n### registerCatch\n\ncatches uncaught promises and errors, displays them verbosely.\n\n```js\nlog.registerCatch()\n\nthrow new Error('eh')\nPromise.reject('eh')\n```\n\n\n## 🆑 clear\n\u003e this will clear the terminal (at least, move it down so it is clear)\n\n```js\nlog.clear()\n```\n\n\n## 🕳 deep\n\n### vs\n| goal                          | winner\n| -------------                 |:-------------:|\n| code source                   | tosource      |\n| deep inside objects           | verbose       |\n| colors                        | verbose       |\n\n### verbose\nusing [inspector-gadget](https://www.npmjs.com/package/inspector-gadget), objects are inspected and colorized as deep as configured\n\n```js\nlog\n  .bold('verbose:')\n  .data({\n    numbers: 1000,\n    booleans: true,\n    functions: () =\u003e {},\n    strings: 'wacky wavy fun',\n  })\n  .verbose(/* optional number for how deep to go */)\n  .echo()\n```\n\n### tosource\n\u003e see the code source\nusing [tosource](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toSource) [for nodejs](https://www.npmjs.com/package/tosource) you can look at the source of a variable\n\n```js\nlog\n  .bold('tosource:')\n  .data({\n    numbers: 1000,\n    booleans: true,\n    functions: () =\u003e {},\n    strings: 'wacky wavy fun',\n  })\n  .tosource()\n  .echo()\n```\n\n## 💈 highlight\n\n![cli-highlight](https://raw.githubusercontent.com/felixfbecker/cli-highlight/master/media/tests.png)\n\n- [cli-highlight](https://www.npmjs.com/package/cli-highlight) (but will not output wrapping html tags around the code, other options are disabled, default themes are used)\n\n```js\nfunction highlitedWithColors() { return 'notice me' }\nlog\n  .data(highlitedWithColors)\n  .tosource()\n  .highlight()\n  .echo()\n```\n\n\n## 🍰 presets\n\n### add your own\n```js\nlog.addPreset('warning', (chain) =\u003e {\n  return chain.text('⚠  warning:').color('bgYellow.black').verbose(10)\n})\n```\n\n### use built-ins\n```js\nlog\n  .preset('warning')\n  .data('nananenano!')\n  .echo()\n\nlog\n  .preset('error')\n  .data(new Error('prettyfull!'))\n  .echo()\n```\n\n\n### ⌛ timestamps\n\n```js\nlog\n  .time(true)\n  .color('cyan')\n  .text('🕳  so deep, so colorful, so meta  🎨  ')\n  .data(log)\n  .verbose()\n  .echo()\n```\n\n\n## from\n\nto use logging from a pure js object, `.from` is available\n\n```js\nlog.from({\n  data: 'data',\n  text: 'eh',\n  color: 'bold',\n  echo: true,\n})\n```\n\n^ is the same as\n\n```js\nlog\n  .text('eh')\n  .data('data')\n  .color('bold')\n  .echo()\n```\n\n\n## 🎢 fun\n\nthese will all be silent by default, so you can easily disable them by filtering your logs or setting silent output which can be exceedingly helpful.\n\n## 🌲 tree\n\n\u003cimg width=\"563\" alt=\"screen shot 2017-06-13 at 11 24 29 pm\" src=\"https://user-images.githubusercontent.com/4022631/27118316-8e138d80-508f-11e7-8ce5-d383678ca2a0.png\"\u003e\n\n```js\nlog\n  .color('green')\n  .text('🌲  treeify')\n  .tree({\n    oranges: {\n      mandarin: {\n        clementine: null,\n        tangerine: 'so cheap and juicy!',\n      },\n    },\n    apples: {\n      'gala': null,\n      'pink lady': null,\n    },\n  })\n  .echo()\n```\n\n### 🎇 sparkly\n\n![sparkly](https://github.com/sindresorhus/sparkly/blob/master/screenshot.png?raw=true)\n\n- options from [sparkly](https://www.npmjs.com/package/sparkly) can be passed in\n- will output a random sparkle if it is not set\n\n```js\nlog.sparkly().echo()\n```\n\n## 📊 bar\n\n![babar](https://github.com/stephan83/babar/raw/master/img/sample.png)\n\n- will output a random bar chart if not set\n- options from [babar](https://www.npmjs.com/package/babar) can be passed in\n\n### random\n\n```js\nlog.bar().echo()\n```\n\n### bar\n\n```js\nconst points = []\nfor (var i = 0; i \u003c Math.PI * 2; i += Math.PI / 1000) {\n  points.push([i, Math.cos(i)]);\n}\nlog.bar(points).echo()\n```\n\n### styles and bar\n\n```js\nlog\n  .bar([[0, 1], [1, 5], [2, 5], [3, 1], [4, 6]])\n  .barStyles({\n    width: 80,\n    height: 10,\n    color: 'yellow',\n    maxY: 100\n  })\n  .echo()\n```\n\n## 📯 beep\n\n![beeper](https://cloud.githubusercontent.com/assets/170270/5261236/f8471100-7a49-11e4-81af-96cd09a522d9.gif)\n\nall options from [beeper](https://www.npmjs.com/package/beeper)\n\n```js\nlog.beep(1).echo()\n```\n\n## 📦 box\n\n![boxen-fliplog](https://cloud.githubusercontent.com/assets/4022631/24585540/d447331a-1741-11e7-83af-e73d308e1794.png)\n\n- all [boxen](https://www.npmjs.com/package/boxen) options\n\n### colors\n\n![boxen-fliplog](https://cloud.githubusercontent.com/assets/4022631/24585616/284cfea2-1744-11e7-94e0-80c2fb031067.png)\n\n```js\n// with bold colors\nlog.bold().box('fliplog').echo()\n\n// echos right away\nlog.box('fliplog', true)\n\n// use boxen box styles\nlog\n  .boxStyles({borderColor: 'blue'})\n  .box('fliplog')\n  .echo()\n```\n\n\n## 🔣 formatting\n\n```js\nlog.data({}).bold('text')\n\n// returns the currently formatted text and data\nconst {text, data} = log.returnVals()\n\n// returns every single setting as an object, resets\nconst everything = log.return()\n```\n\n### 🛰 space\n\nwill output `number` of spaces after your log\n\n```js\nlog.text('followed by 2 empty lines').space(2).echo()\n```\n\n## 🐌 slow\n\nslow mode allows debugging each log step-by-step, and will force a `sleep` usable across all environments using [sleepfor](https://www.npmjs.com/package/sleepfor)\n\n```js\nlog.slow(1000)\nlog.emoji('snail').yellow('slow...').echo()\nconst start = Date.now()\nlog.emoji('snail').yellow('...slow').echo()\nconst end = Date.now() - start\n```\n\n## ⏲ timer\n\nstart, stop, lap, and timer instance using [fliptime](https://www.npmjs.com/package/fliptime)\n\n```js\nlog\n  .startTimer('named')\n  .sleep(1000)\n  .stopTimer('named')\n  .echoTimer('named')\n```\n\nor for more customized usage\n\n```js\nlog.startTimer('named')\n\nsleepfor(1000)\n\nlog.stopTimer('named').echoTimer('named')\n\nconst fliptime = log.fliptime()\n```\n\n### 💱 formatter\n\nallows final formatting of the data before echoing\n\n\u003e ✍ interesting to note, this is how most plugins do their formatting\n\n\n```js\nfunction cb(data) {\n  if (!data || typeof data !== 'object') return data\n\n  Object\n    .keys(data)\n    .forEach(key =\u003e {\n      if (typeof data[key] === 'string')\n        data[key] = data[key].replace(/\\s{2}/gmi, ' ')\n      else if (Array.isArray(data[key]))\n        data[key] = data[key].map(a =\u003e cb(a.name))\n    })\n\n  return data\n}\n\nconst fixture = {\n  str: 'I  have  too  many  spaces',\n  arr: [{name: 'eh'}, {noname: 'just undefined'}],\n}\n\nlog\n.formatter(cb)\n.data(fixture)\n.echo()\n```\n\n## ⚡ performance\n\n#### ⚙ config\nto keep the module lightweight, almost all functionality is added through plugins.\n\n\u003c!-- the dependencies that are installed can be configured by a package json config, or by using magic npm tags which contain the configs.\n\nthe available options are:\n- `min`,\n- `cli`,\n- `debugging`,\n- `formatting`,\n- `fun`,\n- `latest` (default)\n\n##### 📘 package.json\n```js\n\"fliplog\": [\"debugging\"],\n```\n\n##### 📘 magic tags\n```bash\nnpm i --save fliphub@cli\nnpm i --save fliphub@formatting\n```\n\n\n[see the full preset list](https://github.com/fliphub/fliplog/wiki/dynamic-dependencies) --\u003e\n\n#### requiring\n\nall non-core dependencies are required when functions are called **\u0026 the filtering passes**. this way, only the used-functionality is loaded.\n\nadditionally, almost all of the functions are not formatted until `.echo()`, so they will not have dependencies loaded when echoing is false which means code does not have to be changed for production.\n\nif `echo(false)` or [filtering](#-filtering) disables the output, they are never called.\n\n## 🔗 resources\n- for more on the library used for fluent apis, see [⛓ flipchain](https://www.npmjs.com/package/flipchain)\n\n\n## 📝 TODO\n- to file 📒\n- to stream\n- middleware alongside .return\n- configure which keys are persistent across instances\n\n[flipchain-url]: https://www.npmjs.com/package/flipchain\n[npm-image]: https://img.shields.io/npm/v/fliplog.svg\n[npm-url]: https://npmjs.org/package/fliplog\n[standard-image]: https://img.shields.io/badge/code%20style-standard%2Bes6+-brightgreen.svg\n[standard-url]: https://github.com/aretecode/eslint-config-aretecode\n[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license-url]: https://spdx.org/licenses/MIT\n[gitter-badge]: https://img.shields.io/gitter/room/fliphub/pink.svg\n[gitter-url]: https://gitter.im/fliphub/Lobby\n[spinner-img]: https://raw.githubusercontent.com/helloIAmPau/node-spinner/master/img/spinner.gif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffliphub%2Ffliplog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffliphub%2Ffliplog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffliphub%2Ffliplog/lists"}