{"id":21490460,"url":"https://github.com/reactual/c","last_synced_at":"2025-03-17T11:12:56.179Z","repository":{"id":27568020,"uuid":"114437833","full_name":"reactual/c","owner":"reactual","description":"a node.js console.log prettifier :art:  ","archived":false,"fork":false,"pushed_at":"2022-12-07T00:34:32.000Z","size":290,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T05:17:00.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/reactual.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-16T06:00:34.000Z","updated_at":"2020-08-10T15:31:29.000Z","dependencies_parsed_at":"2023-01-14T08:30:46.258Z","dependency_job_id":null,"html_url":"https://github.com/reactual/c","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/reactual%2Fc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactual%2Fc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactual%2Fc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactual%2Fc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactual","download_url":"https://codeload.github.com/reactual/c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244022715,"owners_count":20385134,"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-23T14:37:41.060Z","updated_at":"2025-03-17T11:12:56.154Z","avatar_url":"https://github.com/reactual.png","language":"JavaScript","readme":"\u003cimg src=\"docs/resources/logo_icon.png\" alt=\"Logo\" width=\"86\"\u003e\n\n### **c** (:art:)\n_A console.log prettifier for node.js_\n\n\n## Notice\n\nCurrently under development/unreleased, not for use in production.\n\n\n## Installation\n\nPublished as an npm module under the `@reactual` organization.\n\n```bash\nyarn add @reactual/c\n\n# or via npm\n\nnpm install --save @reactual/c\n```\n\n## Usage\nThere are a few possible ways to use _`c`_ within a project:\n\n### Import Directly As Needed\n\nImport or require from `@reactual/c` in each file as needed. Since _`c`_ is a default export, you can use any variable name you prefer.\n\n```js\n/** ES6 imports */\nimport c from '@reactual/c'\n\n/** or any var preferred */\nimport log from '@reactual/c'\n\n\n/** ES5 require */\nconst c = require('@reactual/c')\n\n/** or any var preferred */\nconst log = require('@reactual/c')\n\n```\n### Logging messages\nReplace normal `console.log` statements with examples below.\n\n\n```js\nconst total = 2 + 2\n\n// console.log('The total is:', total\n\nc('The total is:', total)\n```\n\n### Specifying a log level\nThe most basic usage is to not specify a log level. _`c`_ defaults to `info`, or `error` if the value being logged is an instance of a node.js `Error`. You can also force a specific log level by passing a 3rd argument.\n\n\n```js\n\nconst total = 2 + 2\n\n/** level unspecified, defaults to \"info\" for values that aren't instances of Error */\nc('info unspecified example, total:', total)\n\n/** info, forced with abbreviation */\nc('info example, total:', total, 'i')\n\n/** info, forced with full word */\nc('info, full word example, total:', total, 'info')\n\n/** warn, forced with abbreviation */\nc('warning example, total:', total, 'w')\n\n/** error, forced with abbreviation */\nc('error example, total:', total, 'e')\n\n/** level unspecified, defaults to \"error\" for instances of Error */\nc('error unspecified example, total:', new Error(total))\n\n```\n\nValid values for log level, You can use the full name or abbreviation:\n\n- `info` | `i`\n- `warn` | `w`\n- `error` | `e`\n\nIf you pass an invalid value for level, _`c`_ will ignore it and fallback to `info` or `error` depending on the value being logged.\n\nIn addition to instances of `Error`, the below error classes will default to the `error` level.\n\n- `AssertionError`\n- `RangeError`\n- `ReferenceError`\n- `SyntaxError`\n- `TypeError`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactual%2Fc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactual%2Fc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactual%2Fc/lists"}