{"id":30561051,"url":"https://github.com/0necontroller/borgen","last_synced_at":"2026-03-16T20:31:22.885Z","repository":{"id":90200625,"uuid":"592364995","full_name":"0necontroller/Borgen","owner":"0necontroller","description":"A HTTP request logger middleware for nodeJs. Borgen is a customizable logger which allows you to change the feel of you HTTP request logs.","archived":false,"fork":false,"pushed_at":"2023-03-08T12:13:39.000Z","size":229,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-19T14:05:28.478Z","etag":null,"topics":["borgen","logger-middleware","typescript-library"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/borgen","language":"TypeScript","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/0necontroller.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.MD","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-23T15:21:34.000Z","updated_at":"2024-10-09T13:48:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ac47f97-070f-4ca7-b9c6-c4fd99083a18","html_url":"https://github.com/0necontroller/Borgen","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":0.05882352941176472,"last_synced_commit":"2d1b888cbc5bdbfd01698a7848bb995850970175"},"previous_names":["0necontroller/borgen","codedwells/borgen"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/0necontroller/Borgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0necontroller%2FBorgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0necontroller%2FBorgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0necontroller%2FBorgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0necontroller%2FBorgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0necontroller","download_url":"https://codeload.github.com/0necontroller/Borgen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0necontroller%2FBorgen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272487893,"owners_count":24942762,"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-28T02:00:10.768Z","response_time":74,"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":["borgen","logger-middleware","typescript-library"],"created_at":"2025-08-28T11:11:41.045Z","updated_at":"2026-03-16T20:31:17.865Z","avatar_url":"https://github.com/0necontroller.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Borgen🏅 (The developers👨‍💻 logger)\n\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Downloads][npm-downloads-image]][npm-url]\n[![Coverage Status](https://coveralls.io/repos/github/Codedwells/Borgen/badge.svg?branch=master)](https://coveralls.io/github/Codedwells/Borgen?branch=master)\n\nThe custom Logger for your **Node-Express app**.\n\nA HTTP request logger middleware for nodeJs\n\n![borgen logger](screenshots/borgen.png)\n\n\u003cbr\u003e\n\n---\n\n\u003cbr\u003e\n\n## Installation🏗️\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/). Installation is done using the\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```sh\n$ npm i borgen\n```\n\n**If you use yarn:**\n```sh\n$ yarn add borgen\n```\n\n**If you use pnpm:**\n```sh\n$ pnpm add borgen\n```\n\n\u003cbr\u003e\n\n---\n\n\u003cbr\u003e\n\n## 🚀Usage\n\n```js\nconst { Logger, Borgen } = require('borgen');\n```\n```ts\nimport { Logger,Borgen } from 'borgen';\n```\n\n### Basic use\nThis is the simplest way you can use Borgen, you can however customize \\\nthe colors it uses in logging.\n\n```js\nconst express = require('express');\nconst { Logger, Borgen } = require('borgen');\n\nconst app = express();\napp.use(Borgen({}))\n\nLogger.info({message: 'This is an informational message.'});\nLogger.warn({message:'This is a warning message.'});\nLogger.error({message:'This is an error message.'})\n\napp.listen('3002', () =\u003e {\n    Logger.info({ message: 'The server is running on port 3002'});\n});\n```\n![borgen basic use](./screenshots/borgen_basic.png)\n\n## Available Customizations: 🌞Colors\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue`\n- `magenta`\n- `cyan`\n- `white`\n- `blackBright` (alias: `gray`, `grey`)\n- `redBright`\n- `greenBright`\n- `yellowBright`\n- `blueBright`\n- `magentaBright`\n- `cyanBright`\n- `whiteBright`\n\n\n\u003cbr\u003e\n\n---\n\n\u003cbr\u003e\n\n## Logger💬\n\n\u003cbr\u003e\n\n### Basic usage\n\n```js\nLogger.info({message: 'This is an informational message.'});\nLogger.warn({message:'This is a warning message.'});\nLogger.error({message:'This is an error message.'})\n```\n![Logger basic use](./screenshots/logger_defaults.png)\n\n### Customizing the Colors🧰\nYou can fully customize the color for your log.\n\nLogger has three options:\n- Logger.info( )\n- Logger.warn( )\n- Logger.error( )\n\n\n\u003e Each Logger option has defaults and will fallback if no arguments are passed\n\n```js\nconst express = require('express');\nconst { Logger, Borgen } = require('borgen');\n\nconst app = express();\n\napp.get('/test', (req, res) =\u003e {\n    Logger.warn({ message: 'This is an warning', infoColor: 'yellow', messageColor: 'yellowBright' });\n    res.send('Hello world').end();\n});\n\napp.get('*', (req, res) =\u003e {\n    Logger.error({ message: 'This route does not exist', infoColor: 'red', messageColor: 'redBright' });\n    res.send('404 not found');\n});\n\napp.listen('3001', () =\u003e {\n   Logger.info({ message: 'The server is running on port 3001', infoColor: 'cyanBright', messageColor: 'whiteBright' });\n});\n```\n![Logger custom use](./screenshots/logger_basic.png)\n\u003cbr\u003e\n\n### Logger arguments💥\n- `message` This is the information you want to be logged to the console.\n- `infoColor` This is the color of the first section of the log.\n- `messageColor` This is will be the color of the message you want to log.\n\n\u003cbr\u003e\n\n\u003e Note: infoColor and messageColor are optional and if not passed the logger will\\\n\u003e will use the fallback configuration.\n\n\u003cbr\u003e\n\nUse `CTRL + space` or `Options + space` with infoColor and messageColor to get all\\\nthe colors available.\n\n\u003cbr\u003e\n\n---\n\n\u003cbr\u003e\n\n## Borgen middleware\nThis middleware  is able to handle all you incoming requests and you can \\\n**customize** the colors they are logged in.\n\n### Basic use\n```js\napp.use(Borgen({}))\n```\n![Borgen basic use](screenshots/borgen_defaults.png)\n\n### 🧰Customizing the Colors\nYou can fully customize the color for your incoming requests.\n\n```js\nconst express = require('express');\nconst { Logger, Borgen } = require('borgen');\n\nconst app = express();\napp.use(\n    Borgen({\n        methodColor: {\n            GET: 'greenBright',\n            POST: 'yellow',\n            PUT: 'gray',\n            PATCH: 'gray',\n            DELETE: 'redBright'\n        },\n        routeColor: 'gray',\n        statusColor: 'cyan',\n        resTimeColor: 'gray',\n        statusCodesCl: { serverErr: 'red', clientErr: 'yellow', redirects: 'cyan', success: 'greenBright' }\n    })\n);\n\napp.listen('3001', () =\u003e {\n   Logger.info({ message: 'The server is running on port 3001', infoColor: 'cyanBright', messageColor: 'whiteBright' });\n});\n```\n![Borgen custom use](./screenshots/borgen_custom.png)\n\n### Borgen arguments💥\n- `methodColor` it is an Object which allows you to specify a specific color for different request types.\n- `routeColor` it is the color of the route of the request e.g **/api/v1/users**.\n- `statusColor` it is the color of the status text\n- `resTimeColor` it is the color of how long it took the request to process and give a response.\n- `statusCodesCl` it is where you specify the color of status codes in different ranges\n  - `serverErr` for **5xx**\n  - `clientErr` for **4xx**\n  - `redirects` for **3xx**\n  - `success` for **2xx**\n\n\u003e Note: All this arguments are optional and if not passed the logger will\\\n\u003e will use the fallback configuration.\n\n\u003cbr\u003e\n\n# Save my logs🚀\nUsing this feature you can store you apps log in a file.\\\nThis feature is useful for debugging and for production.\n\n\u003cbr\u003e\n\n## 📑Borgen logs 🐾\n**logs** argument allows you to specify a  path where your log file will be located.\n```js\napp.use(\n    Borgen({\n        logs: '../logs/borgen.log'\n    })\n);\n```\n## 📑Logger logs 🐾\nTo save your logs you need to add the **logs** parameter as an argument.\n\n```js\n Logger.info({ logs: '../logs/info.log' });\n Logger.warn({ logs: '../logs/warnings.log' });\n Logger.error({ logs: '../logs/error.log' });\n```\n\n\u003e \\\n\u003e **Note:** The 🔖log file name can be any custom name. ' ./custom_name.log '\n\u003e ___\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 💪🏽 Thanks to all the awesome Contributors\n\nThanks a lot for spending your time helping Borgen grow. Thanks a lot! Keep rocking🍻\n\n![Contributors](https://contrib.rocks/image?repo=Codedwells/Borgen)\n\n\u003cbr\u003e\n\n---\n\n\u003cbr\u003e\n\n## License📑\n\n[MIT](https://github.com/Codedwells/Borgen/blob/master/LICENSE)\n\n\n[npm-downloads-image]: https://badgen.net/npm/dm/borgen\n[npm-url]: https://npmjs.org/package/borgen\n[npm-version-image]: https://badgen.net/npm/v/borgen\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0necontroller%2Fborgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0necontroller%2Fborgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0necontroller%2Fborgen/lists"}