{"id":21405408,"url":"https://github.com/karimsa/boa","last_synced_at":"2025-07-18T13:36:00.390Z","repository":{"id":41787415,"uuid":"193614289","full_name":"karimsa/boa","owner":"karimsa","description":"Toolkit for building backends in Node.js.","archived":false,"fork":false,"pushed_at":"2023-01-23T23:22:01.000Z","size":1864,"stargazers_count":1,"open_issues_count":20,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-14T02:01:07.503Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karimsa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-25T01:55:11.000Z","updated_at":"2020-06-03T19:25:04.000Z","dependencies_parsed_at":"2023-02-02T21:15:23.888Z","dependency_job_id":null,"html_url":"https://github.com/karimsa/boa","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/karimsa/boa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fboa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fboa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fboa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fboa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karimsa","download_url":"https://codeload.github.com/karimsa/boa/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Fboa/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265769350,"owners_count":23825252,"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-22T16:25:15.291Z","updated_at":"2025-07-18T13:36:00.335Z","avatar_url":"https://github.com/karimsa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# boa [![CircleCI](https://circleci.com/gh/karimsa/boa.svg?style=svg)](https://circleci.com/gh/karimsa/boa)\n\nToolkit for building backends in Node.js.\n\n- [Configuration](#configuration)\n- [Logger](#logger)\n\n## Configuration\n\n- **Read string environment variable**: `Config.string('Redis.Password')` - This will read the environment variable `REDIS_PASSWORD` and will error out if the value is empty.\n- **Read string environment variable with default value**: `Config.string('Redis.Password', 'blah')` - This will try to read the environment variable `REDIS_PASSWORD` and will return `blah` if the value is empty.\n- **Read integer environment variable**: `Config.int('Redis.Port')` - This will read the environment variable `REDIS_PORT` and try to cast it to an integer. If the casting fails or the value is empty, it will fail.\n\nPreloaded variables:\n\n- `Config.NodeEnv` -\u003e `process.env.NODE_ENV`\n- `Config.isTestEnv` -\u003e `true` if `NODE_ENV` is set to `test`.\n- `Config.isDevelopmentEnv` -\u003e `true` if `NODE_ENV` is set to `development`.\n\n## Logger\n\n![](.github/logger.png)\n\nThe exported logger is a wrapper around a hidden winston logger, which by default logs to the console. The logging levels can be configured using the environment variable `LOGGER_LEVEL` - the default is to log `warn` and above. The levels are as follows:\n\n- `error`\n- `warn`\n- `info`\n- `verbose`\n\nAll loggers use `util.format()` \u0026 therefore whatever formatters are supported by your node version (see [docs](https://nodejs.org/api/util.html#util_util_format_format_args)).\n\nThe logger also comes with some extra builtin utilities:\n\n- **errorf**: creates an error object where the message is formatted using the formatter.\n- **fatalf**: builds an error using `errorf()` then throws it.\n- **debug**: takes a namespace as the first parameter and only logs the formatted message if that namespace is enabled using `process.env.DEBUG`.\n\n```javascript\nimport { logger } from '@karimsa/boa'\n\n// errorf\nconst name = await fetchName()\nconst err = logger.errorf('Hello, %s', name)\n// err = new Error('Hello, ' + name)\n\n// fatalf\nlogger.fatalf('hello') // throw logger.errorf('hello')\n\n// debug\nlogger.debug('myapi', 'hello, %s', name)\n```\n\n## License\n\nLicensed under MIT license.\n\nCopyright (C) 2019-present Karim Alibhai.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarimsa%2Fboa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarimsa%2Fboa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarimsa%2Fboa/lists"}