{"id":31897238,"url":"https://github.com/felixheck/laabr","last_synced_at":"2025-10-13T11:18:35.272Z","repository":{"id":38361416,"uuid":"96323589","full_name":"felixheck/laabr","owner":"felixheck","description":"well-formatted, extendable pino logger for hapi.js ","archived":false,"fork":false,"pushed_at":"2023-03-06T05:04:39.000Z","size":1002,"stargazers_count":51,"open_issues_count":7,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-10T17:08:22.062Z","etag":null,"topics":["hapi","hapijs","logger","logging","pino"],"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/felixheck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2017-07-05T13:41:30.000Z","updated_at":"2025-08-21T07:04:01.000Z","dependencies_parsed_at":"2024-06-18T17:11:10.625Z","dependency_job_id":null,"html_url":"https://github.com/felixheck/laabr","commit_stats":{"total_commits":285,"total_committers":7,"mean_commits":"40.714285714285715","dds":"0.35789473684210527","last_synced_commit":"85ace78f5ed637406b410f9dabc1c44211839e6a"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"purl":"pkg:github/felixheck/laabr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixheck%2Flaabr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixheck%2Flaabr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixheck%2Flaabr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixheck%2Flaabr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felixheck","download_url":"https://codeload.github.com/felixheck/laabr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixheck%2Flaabr/sbom","scorecard":{"id":396419,"data":{"date":"2025-08-11","repo":{"name":"github.com/felixheck/laabr","commit":"85ace78f5ed637406b410f9dabc1c44211839e6a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T19:07:16.187Z","repository_id":38361416,"created_at":"2025-08-18T19:07:16.187Z","updated_at":"2025-08-18T19:07:16.187Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011319,"owners_count":26084928,"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-10-12T02:00:06.719Z","response_time":53,"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":["hapi","hapijs","logger","logging","pino"],"created_at":"2025-10-13T11:18:32.435Z","updated_at":"2025-10-13T11:18:35.267Z","avatar_url":"https://github.com/felixheck.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![laabr logo](https://github.com/felixheck/laabr/raw/master/assets/logo.png)\n#### well-formatted, extendable pino logger for hapi.js\n\n\u003e Booyah! Works like a charm.\n\u003e\n\u003e \u0026mdash; [Marcus Pöhls](https://futurestud.io/tutorials/author/marcus/)\n\n[![Travis](https://img.shields.io/travis/felixheck/wurst.svg)](https://travis-ci.org/felixheck/laabr/builds/) ![node](https://img.shields.io/node/v/laabr.svg) ![npm](https://img.shields.io/npm/dt/laabr.svg) [![standard](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](http://standardjs.com/) ![npm](https://img.shields.io/npm/l/laabr.svg) [![Coverage Status](https://coveralls.io/repos/github/felixheck/laabr/badge.svg?branch=master)](https://coveralls.io/github/felixheck/laabr?branch=master)\n---\n\n1. [Introduction](#introduction)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [API ⇗](docs/api.md)\n5. [Tokens ⇗](docs/tokens-formats-presets.md#tokens)\n5. [Formats ⇗](docs/tokens-formats-presets.md#formats)\n7. [Presets ⇗](docs/tokens-formats-presets.md#presets)\n8. [Example](#example)\n9. [Developing and Testing](#developing-and-testing)\n10. [Contribution](#contribution)\n\n---\n\n## Introduction\n**laabr** is a well-formatted [pino ⇗](https://github.com/pinojs/pino) logger for [hapi.js ⇗](https://github.com/hapijs/hapi) which is based on the plugin [hapi-pino ⇗](https://github.com/pinojs/hapi-pino). It enables optionally to log in JSON for easy post-processing. It listens to various [hapi.js events ⇗](docs/tokens-formats-presets.md#formats) and logs in a well-formatted manner. Therefor it is possible to define custom formats alike the [morgan ⇗](https://github.com/expressjs/morgan) ones or make use of available presets. Additionally it enables to define own tokens which could be used in custom formats. *laabr* is the Swabian translation for *talking*.\n\nThe modules [`standard`](https://standardjs.com/) and [`ava`](https://github.com/avajs/ava) are used to grant a high quality implementation.\n\n\n#### Compatibility\n| Major Release | [hapi.js](https://github.com/hapijs/hapi) version | [hapi-pino](https://github.com/pinojs/hapi-pino) version | node version |\n| --- | --- | --- | --- |\n| `v6` | `\u003e=18.4 @hapi/hapi` | `\u003e= 6.3` | `\u003e=12` |\n| `v5.1` | `\u003e=18.3.1 @hapi/hapi` | `\u003e= 5.4` | `\u003e=8` |\n| `v5` | `\u003e=18 hapi` | `\u003e= 5.4` | `\u003e=8` |\n| `v4` | `\u003e=17 hapi` | `\u003e= 5.1` | `\u003e=8` |\n| `v3` | `\u003e=17 hapi` | `\u003e= 3` | `\u003e=8` |\n| `v2` | `\u003e=13 hapi` | `\u003e= 1.6` | `\u003e=6` |\n\n#### `laabr` vs. `hapi-pino`\nFirst of all `laabr` extends the `hapi-pino` plugin. So it is possible to use `laabr` in an almost identical manner like `hapi-pino`. This plugin provides further features which probably decelerates the logging a bit, but it should be faster than the alternatives anyway. The following features are provided:\n\n- Easy out of the box usage\n- Context-sensitive colorization\n- Customizable identation for JSON strings\n- Wide range of preset [tokens ⇗](docs/tokens-formats-presets.md#tokens) to extract and compose data as needed\n- Preset [formats ⇗](docs/tokens-formats-presets.md#formats) combining useful tokens for an easy start\n- Possibility to add own format [presets ⇗](docs/tokens-formats-presets.md#presets) for an easy reuse\n- Easily customizable tokens \u0026 formats\n- Override several [`console` ⇗](https://developer.mozilla.org/en-US/docs/Web/API/Console) logging methods\n- In despite of everything it is possible to [preformat ⇗](docs/api.md#user-content-preformatter) \u0026 [postformat ⇗](docs/api.md#user-content-postformatter) data, e.g. to filter sensitive data\n\n![laabr screen](https://github.com/felixheck/laabr/raw/master/assets/screen.png)\n\n## Installation\nFor installation use the [npm ⇗](https://github.com/npm/npm):\n```\n$ npm install --save laabr\n```\n\nor clone the repository:\n```\n$ git clone https://github.com/felixheck/laabr\n```\n\n## Usage\n#### Import\nFirst you have to import the module:\n``` js\nconst laabr = require('laabr');\n```\n\n#### Create hapi server\nAfterwards create your hapi server if not already done:\n``` js\nconst hapi = require('@hapi/hapi');\nconst server = hapi.server({\n  port: 8888,\n  host: 'localhost',\n});\n```\n\n#### Registration\nFinally register the plugin and set the correct options:\n``` js\nawait server.register({\n  plugin: laabr,\n  options: {},\n});\n```\n\n## Example\nTake a look at several more [examples ⇗](examples/).\u003cbr/\u003e\n\n#### Code\n\n``` js\nconst hapi = require('@hapi/hapi');\nconst laabr = require('laabr');\n\nconst server = hapi.server({ port: 3000 });\n\nconst options = {\n  formats: { onPostStart: ':time :start :level :message' },\n  tokens: { start:  () =\u003e '[start]' },\n  indent: 0\n};\n\nserver.route([\n  {\n    method: '*',\n    path: '/response',\n    handler() {\n      return 'hello world';\n    }\n  },\n  {\n    method: 'GET',\n    path: '/error',\n    handler () {\n      throw new Error('foobar');\n    }\n  }\n]);\n\n(async () =\u003e {\n  try {\n    await server.register({\n      plugin: laabr,\n      options\n    });\n    await server.start();\n    console.log('Server started successfully');\n  } catch (err) {\n    console.error(err);\n  }\n})();\n\nserver.log('info', 'did you mean \"foobar\"?');\n```\n\n#### Output\n\n```\n// (1) `log`\n$ {\"message\":\"did you mean \\\"foobar\\\"?\",\"timestamp\":1499352305938,\"level\":\"info\"}\n\n// (2) `onPostStart`\n$ 1499352305956 [start] info server started\n\n// (3) `response` – calling `/response`\n$ 1499352307927 GET 127.0.0.1 /response 200 {} (25 ms)\n\n// (4) `request-error` \u0026 `response` – calling `/error`\n$ {\"error\":\"foobar\",\"timestamp\":1499352320071,\"level\":\"warn\"}\n$ 1499352320072 GET 127.0.0.1 /error 500 {} (3 ms)\n\n// (5) `onPostStop` – Pressing `Ctrl + C`\n$ 1499352325077 info server stopped\n```\n\n## Developing and Testing\nFirst you have to install all dependencies:\n```\n$ npm install\n```\n\nTo execute all unit tests once, use:\n```\n$ npm test\n```\n\nor to run tests based on file watcher, use:\n```\n$ npm start\n```\n\nTo get information about the test coverage, use:\n```\n$ npm run coverage\n```\n\n## Contribution\nFork this repository and push in your ideas.\n\nDo not forget to add corresponding tests to keep up 100% test coverage.\u003cbr/\u003e\nFor further information read the [contributing guideline](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixheck%2Flaabr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixheck%2Flaabr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixheck%2Flaabr/lists"}