{"id":26647240,"url":"https://github.com/offirmo/prefixed-log","last_synced_at":"2025-09-13T07:16:42.977Z","repository":{"id":57329747,"uuid":"59737142","full_name":"Offirmo/prefixed-log","owner":"Offirmo","description":"A wrapper around a console.log compatible function to add a prefix. Handle all cases and typescript compatible!","archived":false,"fork":false,"pushed_at":"2017-06-01T11:33:23.000Z","size":96,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-24T20:06:15.895Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Offirmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-05-26T09:20:12.000Z","updated_at":"2017-06-01T11:32:23.000Z","dependencies_parsed_at":"2022-09-10T13:51:27.631Z","dependency_job_id":null,"html_url":"https://github.com/Offirmo/prefixed-log","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Offirmo/prefixed-log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Offirmo%2Fprefixed-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Offirmo%2Fprefixed-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Offirmo%2Fprefixed-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Offirmo%2Fprefixed-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Offirmo","download_url":"https://codeload.github.com/Offirmo/prefixed-log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Offirmo%2Fprefixed-log/sbom","scorecard":{"id":104190,"data":{"date":"2025-08-11","repo":{"name":"github.com/Offirmo/prefixed-log","commit":"6137041de32e1fdff5b587dacde41ddd4b0145f0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/27 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":"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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":["Info: Possibly incomplete results: error parsing shell code: a command can only contain words and redirects; encountered (: scripts/build.js:0","Info: Possibly incomplete results: error parsing shell code: a command can only contain words and redirects; encountered (: test/usage_es6.js:0","Info: Possibly incomplete results: error parsing shell code: \u003e must be followed by a word: test/usage_typescript.ts:0"],"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":"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":"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":"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: The Unlicense: 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"}}]},"last_synced_at":"2025-08-15T10:47:13.584Z","repository_id":57329747,"created_at":"2025-08-15T10:47:13.584Z","updated_at":"2025-08-15T10:47:13.584Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274932267,"owners_count":25376121,"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-09-13T02:00:10.085Z","response_time":70,"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":[],"created_at":"2025-03-24T23:51:28.023Z","updated_at":"2025-09-13T07:16:42.910Z","avatar_url":"https://github.com/Offirmo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prefixed-log\n[![NPM version](https://badge.fury.io/js/prefixed-log.png)](http://badge.fury.io/js/prefixed-log)\n[![license](http://img.shields.io/badge/license-public_domain-brightgreen.png)](http://unlicense.org/)\n\nA wrapper around a console.log compatible function to add a prefix to the output, ex.:\n```\n* [foo] hello !\n* [foo] bye !\n\n[1468917781403] \u003e sending request...\n[1468917781407] \u003e handling response...\n```\nA common requirement when debugging.\n\n\nThe trick is that, when the 1st arg is a string :\n* `console.log/warn/etc.` have a special interface which allows to replace `%d` placeholders with remaining params\n* `console.log/warn/etc.` add a spacing between params when not using placeholder\n\nThis small lib take care of everything so that it looks nice.\n\n## installation\n\n```sh\nnpm i --save prefixed-log\n```\n\nThen in your code:\n* node stable (4+): `const makePrefixedLogger = require('prefixed-log').factory`\n* node legacy (\u003c4): `var makePrefixedLogger = require('prefixed-log/dist/index.node-legacy').factory`\n* ES2015/ES6: `import { factory as makePrefixedLogger } from 'prefixed-log'`\n\nNote: there are examples in folder `test/`\n\n## Usage\nNote: there are examples in folder `test/`\n\nSimplest usage:\n```js\nimport { factory as makePrefixedLogger } from 'prefixed-log'\nconst logger = makePrefixedLogger('* [foo]')\n\nlogger('Hello', 42)     --\u003e * [foo] Hello 42\n```\n\nMore advanced usage, specifying a logger:\n```js\nimport { factory as makePrefixedLogger } from 'prefixed-log'\nconst logger = makePrefixedLogger('* [foo]', console.log.bind(console))\n\nlogger('Hello', 42)     --\u003e * [foo] Hello 42\nlogger('Hello %d', 33)  --\u003e * [foo] Hello 33\nlogger({foo: 'bar'})    --\u003e * [foo] { foo: 'bar' }\n```\n\nAnother advanced usage, using a dynamic prefix:\n```js\nimport { factory as makePrefixedLogger } from 'prefixed-log'\nconst logger = makePrefixedLogger(() =\u003e Date.now(), console.log.bind(console))\n\nlogger('Hello', 42)     --\u003e 1464255584287 Hello 42\nlogger('Hello %d', 33)  --\u003e 1464255584288 Hello 33\n```\n\n### Options\n\nThere are secret options :\n\n```js\nconst logger = makePrefixedLogger('* [foo]', {\n  // default values :\n  spacer: ' ',          ///\u003c spacer that will be used between the prefix and the 1st arg *if it is a string*\n  spacerAlt: '',        ///\u003c spacer that will be used between the prefix and the 1st arg *if it is NOT a string*\n  isEnabled: () =\u003e true ///\u003c nothing will be displayed at all if it returns false (useful for disabling debug)\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffirmo%2Fprefixed-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffirmo%2Fprefixed-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffirmo%2Fprefixed-log/lists"}