{"id":16146553,"url":"https://github.com/voxpelli/node-bunyan-adaptor","last_synced_at":"2025-08-26T07:03:53.494Z","repository":{"id":34668933,"uuid":"46007447","full_name":"voxpelli/node-bunyan-adaptor","owner":"voxpelli","description":"Maps the major Pino / Bunyan logging methods to custom methods","archived":false,"fork":false,"pushed_at":"2025-08-01T03:52:19.000Z","size":79,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T02:48:56.122Z","etag":null,"topics":["bunyan","bunyan-interface","console-log","fallbacks","logging","mocking","pino"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voxpelli.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["voxpelli"]}},"created_at":"2015-11-11T20:19:26.000Z","updated_at":"2025-02-12T14:26:15.000Z","dependencies_parsed_at":"2023-12-26T02:28:09.144Z","dependency_job_id":"386328b4-e4cd-45b8-b64d-9d69b6fb57d0","html_url":"https://github.com/voxpelli/node-bunyan-adaptor","commit_stats":{"total_commits":83,"total_committers":4,"mean_commits":20.75,"dds":0.3012048192771084,"last_synced_commit":"492fbec5cca3da5e966e4b627fb6d2217102409e"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/voxpelli/node-bunyan-adaptor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpelli%2Fnode-bunyan-adaptor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpelli%2Fnode-bunyan-adaptor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpelli%2Fnode-bunyan-adaptor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpelli%2Fnode-bunyan-adaptor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voxpelli","download_url":"https://codeload.github.com/voxpelli/node-bunyan-adaptor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voxpelli%2Fnode-bunyan-adaptor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272186219,"owners_count":24888333,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bunyan","bunyan-interface","console-log","fallbacks","logging","mocking","pino"],"created_at":"2024-10-10T00:20:31.111Z","updated_at":"2025-08-26T07:03:53.475Z","avatar_url":"https://github.com/voxpelli.png","language":"JavaScript","funding_links":["https://github.com/sponsors/voxpelli"],"categories":[],"sub_categories":[],"readme":"# Pino / Bunyan Adaptor\n\n[![npm version](https://img.shields.io/npm/v/bunyan-adaptor.svg?style=flat)](https://www.npmjs.com/package/bunyan-adaptor)\n[![npm downloads](https://img.shields.io/npm/dm/bunyan-adaptor.svg?style=flat)](https://www.npmjs.com/package/bunyan-adaptor)\n[![Module type: CJS+ESM](https://img.shields.io/badge/module%20type-cjs%2Besm-brightgreen)](https://github.com/voxpelli/badges-cjs-esm)\n[![Types in JS](https://img.shields.io/badge/types_in_js-yes-brightgreen)](https://github.com/voxpelli/types-in-js)\n[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-7fffff?style=flat\u0026labelColor=ff80ff)](https://github.com/neostandard/neostandard)\n[![Follow @voxpelli@mastodon.social](https://img.shields.io/mastodon/follow/109247025527949675?domain=https%3A%2F%2Fmastodon.social\u0026style=social)](https://mastodon.social/@voxpelli)\n\nTypes and mapper for [Pino](https://github.com/pinojs/pino) / [Bunyan](https://github.com/trentm/node-bunyan) logging methods.\n\nSupport Pino / Bunyan compatible loggers with fallback `console.log()`.\n\n## `BunyanLite` – simplified Pino / Bunyan type subsets\n\nApart from the actual adapter, this module also ships with some useful generic TypeScript types, where `BunyanLite` is the most usable of them.\n\nThe `BunyanLite` type can be used wherever one wants to reference a basic [Pino](https://github.com/pinojs/pino) / [Bunyan](https://github.com/trentm/node-bunyan) subset. That type can then be fulfilled by Pino, Bunyan, a logger created by this module or by another module implementing the same subset.\n\n### All Pino / Bunyan type subsets\n\n* `BunyanLite` – specifies the lite subset of the Bunyan interface that this module supports\n* `BunyanLogMethod` – specifies the very simple syntax for the individual log methods\n* `BunyanChildMethod` – specified the syntax of the `child()` method\n\n### Pino / Bunyan subset that's part of `BunyanLite`\n\n* `.fatal()`\n* `.error()`\n* `.warn()`\n* `.info()`\n* `.debug()`\n* `.trace()`\n* `.child(data)`\n\n## `createLogger()` – map any logger to `BunyanLite` subset\n\nSimple CommonJS example:\n\n```javascript\nconst logger = require('bunyan-adaptor')({\n  log: console.log.bind(console),\n  error: console.error.bind(console),\n});\n\nlogger.error('Warning');      // Uses console.error()\nlogger.info('Informational'); // Uses console.log()\n```\n\nSimple ESM example:\n\n```javascript\nimport createLogger from 'bunyan-adaptor';\n\nconst logger = createLogger({\n  log: console.log.bind(console),\n  error: console.error.bind(console),\n});\n\nlogger.error('Warning');      // Uses console.error()\nlogger.info('Informational'); // Uses console.log()\n```\n\nAlso available as a non-default export:\n\n```javascript\nconst { createLogger } = require('bunyan-adaptor');\nimport { createLogger } from 'bunyan-adaptor';\n```\n\n## createLogger(options)\n\nMaps `options` methods to all seven [Bunyan log levels](https://github.com/trentm/node-bunyan#levels).\n\n* `.fatal()` – maps to `options.fatal` and fallbacks to `options.error` and `options.log` in that order\n* `.error()` – maps to `options.error` and fallbacks to `options.log` in that order\n* `.warn()` – maps to `options.warn` and fallbacks to `options.log`\n* `.info()` – maps to `options.info` and fallbacks to `options.log`\n* `.debug()` – maps to `options.debug` and fallbacks to `options.verbose` and `options.log` in that order\n* `.trace()` – maps to `options.trace` and fallbacks to `options.verbose` and `options.log` in that order\n\n`options.log` itself fallbacks to `console.log()`\n\nIn addition to the above there's also support for:\n\n* `.child(data)` – used to create a child logger. Defaults to built in method, can be overriden using `options.child`\n\n## See also\n\n* [`abstract-logging`](https://www.npmjs.com/package/abstract-logging)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxpelli%2Fnode-bunyan-adaptor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoxpelli%2Fnode-bunyan-adaptor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoxpelli%2Fnode-bunyan-adaptor/lists"}