{"id":21033460,"url":"https://github.com/electerious/ausgabe","last_synced_at":"2025-05-15T13:32:09.322Z","repository":{"id":62239845,"uuid":"558384617","full_name":"electerious/ausgabe","owner":"electerious","description":"Tiny logger with zero defaults.","archived":false,"fork":false,"pushed_at":"2023-04-01T14:47:32.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T09:41:36.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/electerious.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"electerious","custom":["https://paypal.me/electerious","https://www.buymeacoffee.com/electerious"]}},"created_at":"2022-10-27T12:52:03.000Z","updated_at":"2025-03-10T16:26:26.000Z","dependencies_parsed_at":"2024-11-19T12:57:21.741Z","dependency_job_id":"b5b783fb-af31-4277-aafb-fec595c0a800","html_url":"https://github.com/electerious/ausgabe","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"d2735ae331699add2af2e6b806576ab5d1222fa7"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Fausgabe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Fausgabe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Fausgabe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Fausgabe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/electerious","download_url":"https://codeload.github.com/electerious/ausgabe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254349467,"owners_count":22056353,"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":[],"created_at":"2024-11-19T12:57:14.381Z","updated_at":"2025-05-15T13:32:08.682Z","avatar_url":"https://github.com/electerious.png","language":"JavaScript","funding_links":["https://github.com/sponsors/electerious","https://paypal.me/electerious","https://www.buymeacoffee.com/electerious"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# ausgabe\n\n![Build](https://github.com/electerious/ausgabe/workflows/Build/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/electerious/ausgabe/badge.svg?branch=main)](https://coveralls.io/github/electerious/ausgabe?branch=master)\n\nTiny logger with zero defaults.\n\n\u003cbr/\u003e\n\n![ausgabe in action](https://s.electerious.com/images/ausgabe/readme.png)\n\n\u003c/div\u003e\n\n## Contents\n\n- [Description](#description)\n- [Install](#install)\n- [Usage](#usage)\n  - [Basic](#basic)\n  - [Advanced](#advanced)\n  - [Nested](#nested)\n  - [Streams](#streams)\n- [API](#api)\n- [Instance API](#instance-api)\n- [Miscellaneous](#miscellaneous)\n\n## Description\n\n`ausgabe` is designed to output user relevant log messages to the console or to a [custom stream](#streams). It's lightweight, customizable and perfect for tools that need simple, yet beautiful log messages.\n\n## Install\n\n```\nnpm install ausgabe\n```\n\n## Usage\n\n### Basic\n\n```js\nimport { createLogger } from 'ausgabe'\n\nconst instance = createLogger({\n\tinfo: {\n\t\tcolor: 'blue',\n\t\tbadge: 'ℹ',\n\t\tlabel: 'info',\n\t},\n})\n\ninstance.info('Hello world')\n```\n\n### Advanced\n\n```js\nimport figures from 'figures'\nimport { createLogger } from 'ausgabe'\n\nconst instance = createLogger(\n\t{\n\t\tinfo: {\n\t\t\tcolor: 'blue',\n\t\t\tbadge: figures.info,\n\t\t\tlabel: 'info',\n\t\t},\n\t\twarn: {\n\t\t\tcolor: 'yellow',\n\t\t\tbadge: figures.warning,\n\t\t\tlabel: 'warn',\n\t\t\tstack: false,\n\t\t},\n\t\terror: {\n\t\t\tcolor: 'red',\n\t\t\tbadge: figures.cross,\n\t\t\tlabel: 'error',\n\t\t},\n\t},\n\t{\n\t\tindention: 7,\n\t}\n)\n\ninstance.info('Hello world')\ninstance.info('%s %s', 'Hello', 'world')\ninstance.warn(new Error('Logs error without the stack'))\ninstance.error(new Error('Logs error with the stack'))\n```\n\n### Nested\n\n`ausgabe` supports nested logger instances.\n\n```js\nimport { createLogger } from 'ausgabe'\n\nconst instance = createLogger({\n\trequests: createLogger({\n\t\tget: {\n\t\t\tcolor: 'magenta',\n\t\t\tbadge: '↗',\n\t\t\tlabel: 'get',\n\t\t},\n\t\tpost: {\n\t\t\tcolor: 'magenta',\n\t\t\tbadge: '↗',\n\t\t\tlabel: 'post',\n\t\t},\n\t}),\n})\n\ninstance.requests.get('http://example.com')\ninstance.requests.post('http://example.com')\n```\n\n### Streams\n\n`ausgabe` streams to `process.stdout` by default, but also allows custom [writable streams](https://nodejs.org/api/stream.html#stream_writable_streams).\n\n```js\nimport { Writable } from 'node:stream'\nimport { createLogger } from 'ausgabe'\n\nconst stream = new Writable({\n\twrite: (chunk, encoding, callback) =\u003e {\n\t\tconsole.log(chunk.toString())\n\t\tcallback()\n\t},\n})\n\nconst instance = createLogger({\n\tinfo: {\n\t\tcolor: 'blue',\n\t\tbadge: 'ℹ',\n\t\tlabel: 'info',\n\t\tstreams: [stream],\n\t},\n})\n\ninstance.info('Hello world')\n```\n\n## API\n\n### Usage\n\n```js\nimport { createLogger } from 'ausgabe'\n\nconst instance = createLogger({\n\tinfo: {\n\t\tcolor: 'blue',\n\t\tbadge: 'ℹ',\n\t\tlabel: 'info',\n\t},\n})\n```\n\n```js\nimport { createLogger } from 'ausgabe'\n\nconst instance = createLogger(\n\t{\n\t\tinfo: {\n\t\t\tcolor: 'blue',\n\t\t\tbadge: 'ℹ',\n\t\t\tlabel: 'info',\n\t\t},\n\t},\n\t{\n\t\tindention: 6,\n\t}\n)\n```\n\n### Parameters\n\n- `types` `{Object}` Methods of the logger.\n  - `color` `{?String}` Color of the log. Must be supported by [chalk](https://github.com/chalk/chalk). Defaults to `blue`.\n  - `badge` `{?String}` Icon to log along with the message. Using [figures](https://github.com/sindresorhus/figures) is recommended. Defaults to `ℹ`.\n  - `label` `{?String}` Label to log along with the message. Defaults to `info`.\n  - `stack` `{?Boolean}` Determines if the stack of an error should be logged. Defaults to `true`.\n  - `streams` `{?Array}` [Writable streams](https://nodejs.org/api/stream.html#stream_writable_streams) to which the data is written. Defaults to `[process.stdout]`.\n- `options` `{?Object}` Options.\n  - `indention` `{?Integer}` Aligns log messages with a custom indention.\n\n### Returns\n\n- `{Function}({String},{?...*})` [ausgabe instance](#instance-api).\n\n## Instance API\n\n### Usage\n\n```js\ninstance.info('Hello world')\ninstance.info('%s %s', 'Hello', 'world')\n```\n\n### Parameters\n\n- `message` `{String}` Message containing zero or more substitution strings.\n- `substitutions` `{?...*}` Data with which to replace substitution strings within `message`.\n\n## Miscellaneous\n\n### Donate\n\nI am working hard on continuously developing and maintaining my projects. Please consider making a donation to keep the project going strong and me motivated.\n\n- [Become a GitHub sponsor](https://github.com/sponsors/electerious)\n- [Donate via PayPal](https://paypal.me/electerious)\n- [Buy me a coffee](https://www.buymeacoffee.com/electerious)\n\n### Related\n\n- [signale](https://github.com/klaudiosinani/signale) - Highly configurable logging utility\n\n### Links\n\n- [Follow me on Twitter](https://twitter.com/electerious)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felecterious%2Fausgabe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felecterious%2Fausgabe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felecterious%2Fausgabe/lists"}