{"_id":"signale","_rev":"176597","name":"signale","description":"👋 Hackable console logger","dist-tags":{"latest":"1.4.0"},"maintainers":[{"name":"klaudiosinani","email":""}],"time":{"modified":"2021-06-03T11:58:28.000Z","created":"2018-05-07T22:10:08.737Z","1.4.0":"2019-02-26T23:48:06.889Z","1.3.0":"2018-09-08T21:06:37.963Z","1.2.1":"2018-06-17T15:45:49.561Z","1.2.0":"2018-06-11T21:07:28.411Z","1.1.0":"2018-05-20T22:00:05.852Z","1.0.1":"2018-05-16T03:40:58.624Z","1.0.0":"2018-05-16T03:39:03.542Z","0.0.0":"2018-05-07T22:10:08.737Z"},"users":{"modood":true},"author":{"name":"Klaus Sinani","email":"klaussinani@gmail.com","url":"https://klaussinani.github.io"},"repository":{"type":"git","url":"git+https://github.com/klaussinani/signale.git"},"versions":{"1.4.0":{"name":"signale","version":"1.4.0","description":"👋 Hackable console logger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/klaussinani/signale.git"},"author":{"name":"Klaus Sinani","email":"klaussinani@gmail.com","url":"https://klaussinani.github.io"},"maintainers":[{"name":"klaudiosinani","email":""}],"engines":{"node":">=6"},"keywords":["hackable","colorful","console","logger"],"scripts":{"test":"xo"},"dependencies":{"chalk":"^2.3.2","figures":"^2.0.0","pkg-conf":"^2.1.0"},"devDependencies":{"xo":"*"},"options":{"default":{"displayScope":true,"displayBadge":true,"displayDate":false,"displayFilename":false,"displayLabel":true,"displayTimestamp":false,"underlineLabel":true,"underlineMessage":false,"underlinePrefix":false,"underlineSuffix":false,"uppercaseLabel":false}},"xo":{"space":2},"gitHead":"2e347c59f052f7579a3af15337fcb2c6945d50e7","bugs":{"url":"https://github.com/klaussinani/signale/issues"},"homepage":"https://github.com/klaussinani/signale#readme","_id":"signale@1.4.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"klaussinani","email":"klaussinani@gmail.com"},"dist":{"shasum":"c4be58302fb0262ac00fc3d886a7c113759042f1","size":10606,"noattachment":false,"key":"/signale/-/signale-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/signale/download/signale-1.4.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signale_1.4.0_1551224886737_0.913914644656747"},"_hasShrinkwrap":false,"publish_time":1551224886889,"_cnpm_publish_time":1551224886889},"1.3.0":{"name":"signale","version":"1.3.0","description":"👋 Hackable console logger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/klauscfhq/signale.git"},"author":{"name":"Klaus Sinani","email":"klauscfhq@protonmail.com","url":"https://klauscfhq.github.io"},"maintainers":[{"name":"klaudiosinani","email":""}],"engines":{"node":">=6"},"keywords":["hackable","colorful","console","logger"],"scripts":{"test":"xo"},"dependencies":{"chalk":"^2.3.2","figures":"^2.0.0","pkg-conf":"^2.1.0"},"devDependencies":{"xo":"*"},"options":{"default":{"coloredInterpolation":false,"displayScope":true,"displayBadge":true,"displayDate":false,"displayFilename":false,"displayLabel":true,"displayTimestamp":false,"underlineLabel":true,"underlineMessage":false,"underlinePrefix":false,"underlineSuffix":false,"uppercaseLabel":false}},"xo":{"space":2},"gitHead":"89e21d703dfedb424537a02df4fad7b1981bcb67","bugs":{"url":"https://github.com/klauscfhq/signale/issues"},"homepage":"https://github.com/klauscfhq/signale#readme","_id":"signale@1.3.0","_npmVersion":"6.4.1","_nodeVersion":"8.11.1","_npmUser":{"name":"klauscfhq","email":"klauscfhq@protonmail.com"},"dist":{"shasum":"1b4917c2c7a8691550adca0ad1da750a662b4497","size":9252,"noattachment":false,"key":"/signale/-/signale-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/signale/download/signale-1.3.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signale_1.3.0_1536440797801_0.7007968798085615"},"_hasShrinkwrap":false,"publish_time":1536440797963,"_cnpm_publish_time":1536440797963},"1.2.1":{"name":"signale","version":"1.2.1","description":"👋 Hackable console logger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/klauscfhq/signale.git"},"author":{"name":"Klaus Sinani","email":"klauscfhq@protonmail.com","url":"https://klauscfhq.github.io"},"maintainers":[{"name":"klaudiosinani","email":""}],"keywords":["hackable","colorful","console","logger"],"scripts":{"test":"xo"},"dependencies":{"chalk":"^2.3.2","figures":"^2.0.0","pkg-conf":"^2.1.0"},"devDependencies":{"xo":"*"},"options":{"default":{"coloredInterpolation":false,"displayScope":true,"displayBadge":true,"displayDate":false,"displayFilename":false,"displayLabel":true,"displayTimestamp":false,"underlineLabel":true,"underlineMessage":false,"underlinePrefix":false,"underlineSuffix":false,"uppercaseLabel":false}},"xo":{"space":2},"gitHead":"69d5e1866a9f63fa04dc87637479f7148e6616f1","bugs":{"url":"https://github.com/klauscfhq/signale/issues"},"homepage":"https://github.com/klauscfhq/signale#readme","_id":"signale@1.2.1","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"klauscfhq","email":"klauscfhq@protonmail.com"},"dist":{"shasum":"fbd4b952603ea3315dbe9e88f4f482f336cee828","size":657948,"noattachment":false,"key":"/signale/-/signale-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/signale/download/signale-1.2.1.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signale_1.2.1_1529250349439_0.17912819173620154"},"_hasShrinkwrap":false,"publish_time":1529250349561,"_cnpm_publish_time":1529250349561},"1.2.0":{"name":"signale","version":"1.2.0","description":"👋 Hackable console logger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/klauscfhq/signale.git"},"author":{"name":"Klaus Sinani","email":"klauscfhq@protonmail.com","url":"https://klauscfhq.github.io"},"maintainers":[{"name":"klaudiosinani","email":""}],"keywords":["hackable","colorful","console","logger"],"scripts":{"test":"xo"},"dependencies":{"chalk":"^2.3.2","figures":"^2.0.0","pkg-conf":"^2.1.0"},"devDependencies":{"xo":"*"},"options":{"default":{"coloredInterpolation":false,"displayScope":true,"displayBadge":true,"displayDate":false,"displayFilename":false,"displayLabel":true,"displayTimestamp":false,"underlineLabel":true,"underlineMessage":false,"underlinePrefix":false,"underlineSuffix":false,"uppercaseLabel":false}},"xo":{"space":2},"gitHead":"aeb3446a0242feaf53e2e78dcb8ad7fcc334530c","bugs":{"url":"https://github.com/klauscfhq/signale/issues"},"homepage":"https://github.com/klauscfhq/signale#readme","_id":"signale@1.2.0","_npmVersion":"6.1.0","_nodeVersion":"10.4.0","_npmUser":{"name":"klauscfhq","email":"klauscfhq@protonmail.com"},"dist":{"shasum":"b7803f53567f0c4ad65cde71511afe18d1dd0a87","size":615939,"noattachment":false,"key":"/signale/-/signale-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/signale/download/signale-1.2.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signale_1.2.0_1528751248222_0.5786704241516456"},"_hasShrinkwrap":false,"publish_time":1528751248411,"_cnpm_publish_time":1528751248411},"1.1.0":{"name":"signale","version":"1.1.0","description":"👋 Hackable console logger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/klauscfhq/signale.git"},"author":{"name":"Klaus Sinani","email":"klauscfhq@protonmail.com","url":"https://klauscfhq.github.io"},"maintainers":[{"name":"klaudiosinani","email":""}],"keywords":["hackable","colorful","console","logger"],"scripts":{"test":"xo"},"dependencies":{"chalk":"^2.3.2","figures":"^2.0.0","pkg-conf":"^2.1.0"},"devDependencies":{"xo":"*"},"options":{"default":{"displayScope":true,"displayBadge":true,"displayDate":false,"displayFilename":false,"displayLabel":true,"displayTimestamp":false,"underlineLabel":true,"underlineMessage":false}},"xo":{"space":2},"gitHead":"00944088d079b3fe940235d76e9ec54b46be8a3e","bugs":{"url":"https://github.com/klauscfhq/signale/issues"},"homepage":"https://github.com/klauscfhq/signale#readme","_id":"signale@1.1.0","_npmVersion":"6.0.1","_nodeVersion":"8.11.1","_npmUser":{"name":"klauscfhq","email":"klauscfhq@protonmail.com"},"dist":{"shasum":"b2f6d20f09df83c07fe18a968260b628f9d3f0f8","size":614492,"noattachment":false,"key":"/signale/-/signale-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/signale/download/signale-1.1.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signale_1.1.0_1526853605761_0.6848534377661797"},"_hasShrinkwrap":false,"publish_time":1526853605852,"_cnpm_publish_time":1526853605852},"1.0.1":{"name":"signale","version":"1.0.1","description":"👋 Hackable console logger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/klauscfhq/signale.git"},"author":{"name":"Klaus Sinani","email":"klauscfhq@protonmail.com","url":"https://klauscfhq.github.io"},"maintainers":[{"name":"klaudiosinani","email":""}],"scripts":{"test":"xo"},"dependencies":{"chalk":"^2.3.2","figures":"^2.0.0","pkg-conf":"^2.1.0"},"devDependencies":{"xo":"*"},"options":{"default":{"displayScope":true,"displayBadge":true,"displayDate":false,"displayFilename":false,"displayLabel":true,"displayTimestamp":false,"underlineLabel":true,"underlineMessage":false}},"xo":{"space":2},"gitHead":"ebfbe5508b04573e09e2efdc04be51346a61605b","bugs":{"url":"https://github.com/klauscfhq/signale/issues"},"homepage":"https://github.com/klauscfhq/signale#readme","_id":"signale@1.0.1","_npmVersion":"6.0.1","_nodeVersion":"8.11.1","_npmUser":{"name":"klauscfhq","email":"klauscfhq@protonmail.com"},"dist":{"shasum":"29c1a5e6b7943d42ed455130692eb75eb8b94851","size":612281,"noattachment":false,"key":"/signale/-/signale-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/signale/download/signale-1.0.1.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signale_1.0.1_1526442058391_0.7676954015477553"},"_hasShrinkwrap":false,"publish_time":1526442058624,"_cnpm_publish_time":1526442058624},"1.0.0":{"name":"signale","version":"1.0.0","description":"👋 Hackable console logger","license":"MIT","repository":{"type":"git","url":"git+https://github.com/klauscfhq/signale.git"},"author":{"name":"Klaus Sinani","email":"klauscfhq@protonmail.com","url":"https://klauscfhq.github.io"},"maintainers":[{"name":"klaudiosinani","email":""}],"scripts":{"test":"xo"},"dependencies":{"chalk":"^2.3.2","figures":"^2.0.0","pkg-conf":"^2.1.0"},"devDependencies":{"xo":"*"},"options":{"default":{"displayScope":true,"displayBadge":true,"displayDate":false,"displayFilename":false,"displayLabel":true,"displayTimestamp":false,"underlineLabel":true,"underlineMessage":false}},"xo":{"space":2},"gitHead":"ebfbe5508b04573e09e2efdc04be51346a61605b","bugs":{"url":"https://github.com/klauscfhq/signale/issues"},"homepage":"https://github.com/klauscfhq/signale#readme","_id":"signale@1.0.0","_npmVersion":"6.0.1","_nodeVersion":"8.11.1","_npmUser":{"name":"klauscfhq","email":"klauscfhq@protonmail.com"},"dist":{"shasum":"8e69b6c4fed938aa5e58e47761c82ca6a85c216f","size":612668,"noattachment":false,"key":"/signale/-/signale-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/signale/download/signale-1.0.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signale_1.0.0_1526441943400_0.17286838412077765"},"_hasShrinkwrap":false,"publish_time":1526441943542,"_cnpm_publish_time":1526441943542},"0.0.0":{"name":"signale","version":"0.0.0","description":"👋 Fancy console status messages","license":"MIT","repository":{"type":"git","url":"git+https://github.com/klauscfhq/signale.git"},"author":{"name":"Klaus Sinani","email":"klauscfhq@protonmail.com","url":"https://klauscfhq.github.io"},"maintainers":[{"name":"klaudiosinani","email":""}],"scripts":{"test":"xo"},"dependencies":{"camelcase-keys":"^4.2.0","chalk":"^2.3.2","figures":"^2.0.0","pkg-conf":"^2.1.0"},"devDependencies":{"xo":"^0.20.3"},"options":{"default":{"display-scope":true,"display-badge":true,"display-datestamp":false,"display-filename":false,"display-label":true,"display-timestamp":false,"underline-label":true,"underline-message":false}},"xo":{"space":2},"gitHead":"901ff377f0c8c0294c3c3184d17755b1ea5b2498","bugs":{"url":"https://github.com/klauscfhq/signale/issues"},"homepage":"https://github.com/klauscfhq/signale#readme","_id":"signale@0.0.0","_npmVersion":"6.0.0","_nodeVersion":"8.11.1","_npmUser":{"name":"klauscfhq","email":"klauscfhq@protonmail.com"},"dist":{"shasum":"6eb159cf519690bb5efb98474bb6801b1449db92","size":3946,"noattachment":false,"key":"/signale/-/signale-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/signale/download/signale-0.0.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/signale_0.0.0_1525731008654_0.12410047200513419"},"_hasShrinkwrap":false,"publish_time":1525731008737,"_cnpm_publish_time":1525731008737}},"readme":"<h1 align=\"center\">\n  Signale\n</h1>\n\n<h4 align=\"center\">\n  ???? Hackable console logger\n</h4>\n\n<div align=\"center\">\n  <img alt=\"Header\" src=\"media/header.png\" width=\"88%\">\n</div>\n\n<p align=\"center\">\n  <a href=\"https://travis-ci.com/klaussinani/signale\">\n    <img alt=\"Build Status\" src=\"https://travis-ci.com/klaussinani/signale.svg?branch=master\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/signale\">\n    <img alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dt/signale.svg\">\n  </a>\n</p>\n\n## Description\n\nHackable and configurable to the core, signale can be used for logging purposes, status reporting, as well as for handling the output rendering process of other node modules and applications.\n\nRead this document in: [简体中文](https://github.com/klaussinani/signale/blob/master/docs/readme.zh_CN.md).\n\nVisit the [contributing guidelines](https://github.com/klaussinani/signale/blob/master/contributing.md#translating-documentation) to learn more on how to translate this document into more languages.\n\nCome over to [Gitter](https://gitter.im/klaussinani/signale) or [Twitter](https://twitter.com/klaussinani) to share your thoughts on the project.\n\n## Highlights\n\n- 16 out-of-the-box loggers\n- Hackable to the core\n- Clean and beautiful output\n- Integrated timers\n- Custom pluggable loggers\n- Interactive and regular modes\n- Secrets & sensitive information filtering\n- Filename, date and timestamp support\n- Scoped loggers and timers\n- Scaled logging levels mechanism\n- String interpolation support\n- Multiple configurable writable streams\n- Simple and minimal syntax\n- Globally configurable through `package.json`\n- Overridable configuration per file and logger\n\n## Contents\n\n- [Description](#description)\n- [Highlights](#highlights)\n- [Install](#install)\n- [Usage](#usage)\n- [Configuration](#configuration)\n- [API](#api)\n- [Development](#development)\n- [Related](#related)\n- [Who's Using It?](#whos-using-it)\n- [Team](#team)\n- [License](#license)\n\n## Install\n\n```bash\nnpm install signale\n```\n\n## Usage\n\n### Default Loggers\n\nImport signale and start using any of the default loggers.\n\n<details>\n<summary>View all of the available loggers.</summary>\n\n<br/>\n\n- `await`\n- `complete`\n- `error`\n- `debug`\n- `fatal`\n- `fav`\n- `info`\n- `note`\n- `pause`\n- `pending`\n- `star`\n- `start`\n- `success`\n- `wait`\n- `warn`\n- `watch`\n- `log`\n\n</details>\n\n<br/>\n\n```js\nconst signale = require('signale');\n\nsignale.success('Operation successful');\nsignale.debug('Hello', 'from', 'L59');\nsignale.pending('Write release notes for %s', '1.2.0');\nsignale.fatal(new Error('Unable to acquire lock'));\nsignale.watch('Recursively watching build directory...');\nsignale.complete({prefix: '[task]', message: 'Fix issue #59', suffix: '(@klauscfhq)'});\n```\n\n<div align=\"center\">\n  <img alt=\"Default Loggers\" src=\"media/default-loggers.png\" width=\"65%\">\n</div>\n\n### Custom Loggers\n\nTo create a custom logger define an `options` object yielding a `types` field with the logger data and pass it as argument to a new signale instance.\n\n```js\nconst {Signale} = require('signale');\n\nconst options = {\n  disabled: false,\n  interactive: false,\n  logLevel: 'info',\n  scope: 'custom',\n  secrets: [],\n  stream: process.stdout,\n  types: {\n    remind: {\n      badge: '**',\n      color: 'yellow',\n      label: 'reminder',\n      logLevel: 'info'\n    },\n    santa: {\n      badge: '????',\n      color: 'red',\n      label: 'santa',\n      logLevel: 'info'\n    }\n  }\n};\n\nconst custom = new Signale(options);\ncustom.remind('Improve documentation.');\ncustom.santa('Hoho! You have an unused variable on L45.');\n```\n\n<div align=\"center\">\n  <img alt=\"Custom Loggers\" src=\"media/custom-loggers.png\" width=\"70%\">\n</div>\n\nHere is an example where we override the default `error` and `success` loggers.\n\n```js\nconst {Signale} = require('signale');\n\nconst options = {\n  types: {\n    error: {\n      badge: '!!',\n      label: 'fatal error'\n    },\n    success: {\n      badge: '++',\n      label: 'huge success'\n    }\n  }\n};\n\nconst signale = new Signale();\nsignale.error('Default Error Log');\nsignale.success('Default Success Log');\n\nconst custom = new Signale(options);\ncustom.error('Custom Error Log');\ncustom.success('Custom Success Log');\n```\n\n<div align=\"center\">\n  <img alt=\"Default Loggers\" src=\"media/override-defaults.png\" width=\"65%\">\n</div>\n\nThe `options` object can hold any of the following attributes: `disabled`, `interactive`, `stream`, `scope` and `types`. \n\n##### `disabled`\n\n- Type: `Boolean`\n- Default: `false`\n\nDisables the logging functionality of all loggers belonging to the created instance.\n\n##### `interactive`\n\n- Type: `Boolean`\n- Default: `false`\n\nSwitches all loggers belonging to the created instance into the interactive mode.\n\n##### `logLevel`\n\n- Type: `String`\n- Default: `'info'`\n\nSets the general logging level of the created instance. Can be `'info'` - logs all messages of all loggers, `'timer'` - logs only messages of `time`, `timeEnd`, `debug`, `warn`, `error` & `fatal` loggers, `'debug'` - logs only messages of `debug`, `warn`, `error` & `fatal` loggers, `'warn'` - logs only messages of `warn`, `error` & `fatal` loggers & `'error'` - logs only messages of `error` & `fatal` loggers.\n\n##### `secrets`\n\n- Type: `(String|Number)[]`\n- Default: `[]`\n\nAn array holding secrets/sensitive-information to be removed from the body and metadata of to-be-logged messages and replaced with the default `'[secure]'` string.\n\n##### `stream`\n\n- Type: `stream.Writable|stream.Writable[]`\n- Default: `process.stdout`\n\nDestination to which the data is written, can be a single valid [Writable stream](https://nodejs.org/api/stream.html#stream_writable_streams) or an array holding multiple valid Writable streams.\n\n##### `scope`\n\n- Type: `String|String[]`\n\nName of the scope the logger is reporting from.\n\n##### `types`\n\n- Type: `Object`\n\nHolds the configuration of the custom and default loggers.\n\nAdditionally, the configuration object of each custom/default logger type, defined in the `types` option, can hold any of the following attributes: `badge`, `label`, `color` and `logLevel`. \n\n##### `badge`\n\n- Type: `String`\n\nThe icon corresponding to the logger.\n\n##### `label`\n\n- Type: `String`\n\nThe label used to identify the type of the logger.\n\n##### `color`\n\n- Type: `String`\n\nThe color of the label, can be any of the foreground colors supported by [chalk](https://github.com/chalk/chalk#colors).\n\n##### `logLevel`\n\n- Type: `String`\n- Default: `'info'`\n\nThe log level corresponding to the logger. Messages originating from the logger are displayed only if the log level is greater or equal to the above described general logging level `logLevel` of the `Signale` instance.\n\n### Scoped Loggers\n\nTo create a scoped logger from scratch, define the `scope` field inside the `options` object and pass it as argument to a new signale instance.\n\n```js\nconst {Signale} = require('signale');\n\nconst options = {\n  scope: 'global scope'\n};\n\nconst global = new Signale(options);\nglobal.success('Successful Operation');\n```\n\n<div align=\"center\">\n  <img alt=\"Scope Vanilla\" src=\"media/scope-vanilla.png\" width=\"65%\">\n</div>\n\nTo create a scoped logger based on an already existing one, use the `scope()` function, which will return a new signale instance, inheriting all custom loggers, timers, streams, configuration, interactive mode & disabled statuses from the initial one.\n\n```js\nconst signale = require('signale');\n\nconst global = signale.scope('global scope');\nglobal.success('Hello from the global scope');\n\nfunction foo() {\n  const outer = global.scope('outer', 'scope');\n  outer.success('Hello from the outer scope');\n  \n  setTimeout(() => {\n    const inner = outer.scope('inner', 'scope'); \n    inner.success('Hello from the inner scope');\n  }, 500);\n}\n\nfoo();\n```\n\n<div align=\"center\">\n  <img alt=\"Scope Existing\" src=\"media/scope-existing.png\" width=\"65%\">\n</div>\n\n### Interactive Loggers\n\nTo initialize an interactive logger, create a new signale instance with the [`interactive`](#interactive) attribute set to `true`. While into the interactive mode, previously logged messages originating from an interactive logger, will be overridden only by new ones originating from the same or a different interactive logger. Note that regular messages originating from regular loggers are not overridden by the interactive ones.\n\n```js\nconst {Signale} = require('signale');\n\nconst interactive = new Signale({interactive: true, scope: 'interactive'});\n\ninteractive.await('[%d/4] - Process A', 1);\n\nsetTimeout(() => {\n  interactive.success('[%d/4] - Process A', 2);\n  setTimeout(() => {\n    interactive.await('[%d/4] - Process B', 3);\n    setTimeout(() => {\n      interactive.error('[%d/4] - Process B', 4);\n      setTimeout(() => {}, 1000);\n    }, 1000);\n  }, 1000);\n}, 1000);\n```\n\n<div align=\"center\">\n  <img alt=\"Interactive Mode\" src=\"media/interactive-mode.gif\" width=\"65%\">\n</div>\n\n### Writable Streams\n\nBy default, all signale instances log their messages to the `process.stdout` stream. This can be modified, to match your own preference, through the [`stream`](#stream) property, where you can define a single or multiple valid Writable streams, which will be used by all logger types to log your data. Additionally, it is possible to define one or more Writable streams exclusively for a specific logger type, thus write data independently from the rest logger types.\n\n```js\nconst {Signale} = require('signale');\n\nconst options = {\n  stream: process.stderr, // All loggers will now write to `process.stderr`\n  types: {\n    error: {\n      // Only `error` will write to both `process.stdout` & `process.stderr`\n      stream: [process.stdout, process.stderr]\n    }\n  }\n};\n\nconst signale = new Signale(options);\nsignale.success('Message will appear on `process.stderr`');\nsignale.error('Message will appear on both `process.stdout` & `process.stderr`');\n```\n\n<div align=\"center\">\n  <img alt=\"Writable Streams\" src=\"media/writable-streams.png\" width=\"73%\">\n</div>\n\n### Secrets Filtering\n\nBy utilizing the `secrets` option, secrets and other sensitive information can be filtered out from the body as well as the metadata, i.e. scope names etc, of to-be-logged messages. The option is part of the configuration object passed to a `Signale` instance on its initialization, and is of type `Array<String|Number>`. The array can hold multiple secrets, all of which are removed, if present, from the to-be-logged messages and are replaced with the default `'[secure]'` string. Additionally, when the unary `signale.scope(name)` function is used, the returned `Signale` instance inherits all the secrets belonging to its parent. The secrets checking process is performed in a **case-sensitive** manner. Also, the unary [`signale.addSecrets()`](https://github.com/klaussinani/signale#signaleaddsecretssecrets) and the nullary [`signale.clearSecrets()`](https://github.com/klaussinani/signale#signaleclearsecrets) functions are available through the API for adding and clearing secrets respectively.\n\nIt is **critical** and **highly recommended** to **not type directly secrets in your code**, thus the following example serves **only** as a simple & easily reproducible usage demonstration.\n\n```js\nconst {Signale} = require('signale');\n\n// In reality secrets could be securely fetched/decrypted through a dedicated API \nconst [USERNAME, TOKEN] = ['klaussinani', 'token'];\n\nconst logger1 = new Signale({\n  secrets: [USERNAME, TOKEN]\n});\n\nlogger1.log('$ exporting USERNAME=%s', USERNAME);\nlogger1.log('$ exporting TOKEN=%s', TOKEN);\n\n// `logger2` inherits all secrets from its parent `logger1`\nconst logger2 = logger1.scope('parent');\n\nlogger2.log('$ exporting USERNAME=%s', USERNAME);\nlogger2.log('$ exporting TOKEN=%s', TOKEN);\n```\n\n<div align=\"center\">\n  <img alt=\"Secrets Filtering\" src=\"media/filter-secrets.png\" width=\"73%\">\n</div>\n\n### Timers\n\nTimer are managed by the `time()` and `timeEnd()` functions. A unique label can be used to identify a timer on initialization, though if none is provided the timer will be assigned one automatically. In addition, calling the `timeEnd()` function without a specified label will have as effect the termination of the most recently initialized timer, that was created without providing a label.\n\n```js\nconst signale = require('signale');\n\nsignale.time('test');\nsignale.time();\nsignale.time();\n\nsetTimeout(() => {\n  signale.timeEnd();\n  signale.timeEnd();\n  signale.timeEnd('test');\n}, 500);\n```\n\n<div align=\"center\">\n  <img alt=\"Timers\" src=\"media/timers.png\" width=\"60%\">\n</div>\n\n## Configuration\n\n### Global\n\nTo enable global configuration define the options under the `signale` namespace in your `package.json`.\n\nThe following illustrates all the available options with their respective default values.\n\n```json\n{\n  \"signale\": {\n    \"displayScope\": true,\n    \"displayBadge\": true,\n    \"displayDate\": false,\n    \"displayFilename\": false,\n    \"displayLabel\": true,\n    \"displayTimestamp\": false,\n    \"underlineLabel\": true,\n    \"underlineMessage\": false,\n    \"underlinePrefix\": false,\n    \"underlineSuffix\": false,\n    \"uppercaseLabel\": false\n  }\n}\n```\n\n<details>\n<summary>View all of the available options in detail.</summary>\n\n##### `displayScope`\n\n- Type: `Boolean`\n- Default: `true`\n\nDisplay the scope name of the logger. \n\n##### `displayBadge`\n\n- Type: `Boolean`\n- Default: `true`\n\nDisplay the badge of the logger.\n\n##### `displayDate`\n\n- Type: `Boolean`\n- Default: `false`\n\nDisplay the current local date in `YYYY-MM-DD` format. \n\n##### `displayFilename`\n\n- Type: `Boolean`\n- Default: `false`\n\nDisplay the name of the file that the logger is reporting from.\n\n##### `displayLabel`\n\n- Type: `Boolean`\n- Default: `true`\n\nDisplay the label of the logger.\n\n##### `displayTimestamp`\n\n- Type: `Boolean`\n- Default: `false`\n\nDisplay the current local time in `HH:MM:SS` format.\n\n##### `underlineLabel`\n\n- Type: `Boolean`\n- Default: `true`\n\nUnderline the logger label.\n\n##### `underlineMessage`\n\n- Type: `Boolean`\n- Default: `false`\n\nUnderline the logger message.\n\n##### `underlinePrefix`\n\n- Type: `Boolean`\n- Default: `false`\n\nUnderline the logger prefix.\n\n##### `underlineSuffix`\n\n- Type: `Boolean`\n- Default: `false`\n\nUnderline the logger suffix.\n\n##### `uppercaseLabel`\n\n- Type: `Boolean`\n- Default: `false`\n\nDisplay the label of the logger in uppercase.\n\n</details>\n\n### Local\n\nTo enable local configuration call the `config()` function on your signale instance. Local configurations will always override any pre-existing configuration inherited from `package.json`.\n\nIn the following example, loggers in the `foo.js` file will run under their own configuration, overriding the `package.json` one.\n\n```js\n// foo.js\nconst signale = require('signale');\n\n// Overrides any existing `package.json` config\nsignale.config({\n  displayFilename: true,\n  displayTimestamp: true,\n  displayDate: false\n}); \n\nsignale.success('Hello from the Global scope');\n```\n\n<div align=\"center\">\n  <img alt=\"Local Config\" src=\"media/local-config.png\" width=\"65%\">\n</div>\n\nAlso, scoped loggers can have their own independent configuration, overriding the one inherited by the parent instance or `package.json`. \n\n```js\n// foo.js\nconst signale = require('signale');\n\nsignale.config({\n  displayFilename: true,\n  displayTimestamp: true,\n  displayDate: false\n});\n\nsignale.success('Hello from the Global scope');\n\nfunction foo() {\n  // `fooLogger` inherits the config of `signale`\n  const fooLogger = signale.scope('foo scope');\n\n  // Overrides both `signale` and `package.json` configs\n  fooLogger.config({\n    displayFilename: true,\n    displayTimestamp: false,\n    displayDate: true\n  });\n\n  fooLogger.success('Hello from the Local scope');\n}\n\nfoo();\n```\n\n<div align=\"center\">\n  <img alt=\"Scope Config\" src=\"media/scope-config.png\" width=\"65%\">\n</div>\n\n## API\n\n#### signale.`<logger>(message[, message]|messageObj|errorObj)`\n\n##### **`logger`**\n\n- Type: `Function`\n\nCan be any default or custom logger.\n\n##### **`message`**\n\n- Type: `String`\n\nCan be one or more comma delimited strings.\n\n```js\nconst signale = require('signale');\n\nsignale.success('Successful operation');\n//=> ✔  success  Successful operation\n\nsignale.success('Successful', 'operation');\n//=> ✔  success  Successful operation\n\nsignale.success('Successful %s', 'operation');\n//=> ✔  success  Successful operation\n```\n\n##### **`errorObj`**\n\n- Type: `Error Object`\n\nCan be any error object.\n\n```js\nconst signale = require('signale');\n\nsignale.error(new Error('Unsuccessful operation'));\n//=> ✖  error  Error: Unsuccessful operation\n//        at Module._compile (module.js:660:30)\n//        at Object.Module._extensions..js (module.js:671:10)\n//        ...\n```\n\n##### **`messageObj`**\n\n- Type: `Object`\n\nCan be an object holding the `prefix`, `message` and `suffix` attributes, with `prefix` and `suffix` always prepended and appended respectively to the logged `message`.\n\n```js\nconst signale = require('signale');\n\nsignale.complete({prefix: '[task]', message: 'Fix issue #59', suffix: '(@klaussinani)'});\n//=> [task] ☒  complete  Fix issue #59 (@klaussinani)\n\nsignale.complete({prefix: '[task]', message: ['Fix issue #%d', 59], suffix: '(@klaussinani)'});\n//=> [task] ☒  complete  Fix issue #59 (@klaussinani)\n```\n\n#### signale.`scope(name[, name])`\n\nDefines the scope name of the logger.\n\n##### **`name`**\n\n- Type: `String`\n\nCan be one or more comma delimited strings.\n\n```js\nconst signale = require('signale');\n\nconst foo = signale.scope('foo'); \nconst fooBar = signale.scope('foo', 'bar');\n\nfoo.success('foo');\n//=> [foo] › ✔  success  foo\n\nfooBar.success('foo bar');\n//=> [foo] [bar] › ✔  success  foo bar\n```\n\n#### signale.`unscope()`\n\nClears the scope name of the logger.\n\n```js\nconst signale = require('signale');\n\nconst foo = signale.scope('foo'); \n\nfoo.success('foo');\n//=> [foo] › ✔  success  foo\n\nfoo.unscope();\n\nfoo.success('foo');\n//=> ✔  success  foo\n```\n\n#### signale.`config(settingsObj)`\n\nSets the configuration of an instance overriding any existing global or local configuration.\n\n##### **`settingsObj`**\n\n- Type: `Object`\n\nCan hold any of the documented [options](#global).\n\n```js\n// foo.js\nconst signale = require('signale');\n\nsignale.config({\n  displayFilename: true,\n  displayTimestamp: true,\n  displayDate: true\n});\n\nsignale.success('Successful operations');\n//=> [2018-5-15] [11:12:38] [foo.js] › ✔  success  Successful operations\n```\n\n#### signale.`time([, label])`\n\n- Return Type: `String`\n\nSets a timers and accepts an optional label. If none provided the timer will receive a unique label automatically.\n\nReturns a string corresponding to the timer label. \n\n##### **`label`**\n\n- Type: `String`\n\nLabel corresponding to the timer. Each timer must have its own unique label.\n\n```js\nconst signale = require('signale');\n\nsignale.time();\n//=> ▶  timer_0  Initialized timer...\n\nsignale.time();\n//=> ▶  timer_1  Initialized timer...\n\nsignale.time('label');\n//=> ▶  label    Initialized timer...\n```\n\n#### signale.`timeEnd([, label])`\n\n- Return Type: `Object`\n\nDeactivates the timer to which the given label corresponds. If no label is provided the most recent timer, that was created without providing a label, will be deactivated.\n\nReturns an object `{label, span}` holding the timer label and the total running time.\n\n##### **`label`**\n\n- Type: `String`\n\nLabel corresponding to the timer, each timer has its own unique label.\n\n```js\nconst signale = require('signale');\n\nsignale.time();\n//=> ▶  timer_0  Initialized timer...\n\nsignale.time();\n//=> ▶  timer_1  Initialized timer...\n\nsignale.time('label');\n//=> ▶  label    Initialized timer...\n\nsignale.timeEnd();\n//=> ◼  timer_1  Timer run for: 2ms\n\nsignale.timeEnd();\n//=> ◼  timer_0  Timer run for: 2ms\n\nsignale.timeEnd('label');\n//=> ◼  label    Timer run for: 2ms\n```\n\n#### signale.`disable()`\n\nDisables the logging functionality of all loggers belonging to a specific instance.\n\n```js\nconst signale = require('signale');\n\nsignale.success('foo');\n//=> ✔  success  foo\n\nsignale.disable();\n\nsignale.success('foo');\n//=>\n```\n\n#### signale.`enable()`\n\nEnables the logging functionality of all loggers belonging to a specific instance.\n\n```js\nconst signale = require('signale');\n\nsignale.disable();\n\nsignale.success('foo');\n//=>\n\nsignale.enable();\n\nsignale.success('foo');\n//=> ✔  success  foo\n```\n\n#### signale.`isEnabled()`\n\nChecks whether the logging functionality of a specific instance is enabled.\n\n```js\nconst signale = require('signale');\n\nsignale.success('foo');\n//=> ✔  success  foo\n\nsignale.isEnabled();\n// => true\n\nsignale.disable();\n\nsignale.success('foo');\n//=>\n\nsignale.isEnabled();\n// => false\n```\n\n#### signale.`addSecrets(secrets)`\n\nAdds new secrets/sensitive-information to the targeted Signale instance.\n\n##### **`secrets`**\n\n- Type: `(String|Number)[]`\n\nArray holding the secrets/sensitive-information to be filtered out.\n\n```js\nconst signale = require('signale');\n\nsignale.log('$ exporting USERNAME=%s', 'klaussinani');\n//=> $ exporting USERNAME=klaussinani\n\nsignale.addSecrets(['klaussinani']);\n\nsignale.log('$ exporting USERNAME=%s', 'klaussinani');\n//=> $ exporting USERNAME=[secure]\n```\n\n#### signale.`clearSecrets()`\n\nRemoves all secrets/sensitive-information from the targeted Signale instance.\n\n```js\nconst signale = require('signale');\n\nsignale.addSecrets(['klaussinani']);\n\nsignale.log('$ exporting USERNAME=%s', 'klaussinani');\n//=> $ exporting USERNAME=[secure]\n\nsignale.clearSecrets();\n\nsignale.log('$ exporting USERNAME=%s', 'klaussinani');\n//=> $ exporting USERNAME=klaussinani\n```\n\n## Development\n\nFor more info on how to contribute to the project, please read the [contributing guidelines](https://github.com/klaussinani/signale/blob/master/contributing.md).\n\n- Fork the repository and clone it to your machine\n- Navigate to your local fork: `cd signale`\n- Install the project dependencies: `npm install` or `yarn install`\n- Lint code for errors: `npm test` or `yarn test`\n\n## Related\n\n- [qoa](https://github.com/klaussinani/qoa) - Minimal interactive command-line prompts\n- [taskbook](https://github.com/klaussinani/taskbook) - Tasks, boards & notes for the command-line habitat\n- [hyperocean](https://github.com/klaussinani/hyperocean) - Deep oceanic blue Hyper terminal theme\n\n## Who's Using It?\n\n- [Boostnote](https://github.com/BoostIO/Boostnote)\n- [Docz](https://github.com/pedronauck/docz)\n- [Remix by Ethereum](https://github.com/ethereum/remix)\n- [Semantic Release](https://github.com/semantic-release/semantic-release)\n- [Shower](https://github.com/shower/shower)\n- [Taskbook](https://github.com/klaussinani/taskbook)\n- [Vant](https://github.com/youzan/vant)\n\nView in detail all the packages and repositories that are using Signale [here](https://github.com/klaussinani/signale/network/dependents).\n\n## Team\n\n- Klaus Sinani [(@klaussinani)](https://github.com/klaussinani)\n\n## License\n\n[MIT](https://github.com/klaussinani/signale/blob/master/license.md)\n","_attachments":{},"homepage":"https://github.com/klaussinani/signale#readme","bugs":{"url":"https://github.com/klaussinani/signale/issues"},"license":"MIT"}