{"id":36542434,"url":"https://github.com/vanillaes/mock-console","last_synced_at":"2026-01-12T05:48:41.556Z","repository":{"id":44790008,"uuid":"239690628","full_name":"vanillaes/mock-console","owner":"vanillaes","description":"Mock the 'console' (ie log, info, error) for testing","archived":false,"fork":false,"pushed_at":"2022-01-24T14:41:19.000Z","size":278,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T04:28:27.584Z","etag":null,"topics":["console","esm","esmodules","mock","testing"],"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/vanillaes.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":"2020-02-11T06:16:18.000Z","updated_at":"2021-11-15T23:48:45.000Z","dependencies_parsed_at":"2022-07-25T23:17:27.502Z","dependency_job_id":null,"html_url":"https://github.com/vanillaes/mock-console","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/vanillaes/mock-console","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillaes%2Fmock-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillaes%2Fmock-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillaes%2Fmock-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillaes%2Fmock-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanillaes","download_url":"https://codeload.github.com/vanillaes/mock-console/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanillaes%2Fmock-console/sbom","scorecard":{"id":915972,"data":{"date":"2025-08-11","repo":{"name":"github.com/vanillaes/mock-console","commit":"ce9f0240c227f455e8a8081dc682e4f0adf8fc40"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"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":10,"reason":"no dangerous workflow patterns detected","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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/latest.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/latest.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/vanillaes/mock-console/latest.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/latest.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/vanillaes/mock-console/latest.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/latest.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/vanillaes/mock-console/latest.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/vanillaes/mock-console/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/vanillaes/mock-console/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/vanillaes/mock-console/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/vanillaes/mock-console/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/vanillaes/mock-console/release.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/latest.yml:34","Warn: npmCommand not pinned by hash: .github/workflows/release.yml:30","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 npmCommand dependencies pinned"],"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":"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: 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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"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"}}]},"last_synced_at":"2025-08-24T20:59:58.085Z","repository_id":44790008,"created_at":"2025-08-24T20:59:58.085Z","updated_at":"2025-08-24T20:59:58.085Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"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":["console","esm","esmodules","mock","testing"],"created_at":"2026-01-12T05:48:39.619Z","updated_at":"2026-01-12T05:48:41.551Z","avatar_url":"https://github.com/vanillaes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eMock-Console\u003c/h1\u003e\n\nMock-Console is a small ES module implementation of a console mock. It allows enabling, disabling, and capturing the output of the built-in console methods.\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/vanillaes/mock-console/releases\"\u003e\u003cimg src=\"https://badgen.net/github/tag/vanillaes/mock-console\" alt=\"GitHub Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@vanillaes/mock-console\"\u003e\u003cimg src=\"https://badgen.net/npm/v/@vanillaes/mock-console\" alt=\"NPM Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=@vanillaes/mock-console\"\u003e\u003cimg src=\"https://badgen.net/bundlephobia/minzip/@vanillaes/mock-console\" alt=\"Bundlephobia\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/vanillaes/mock-console/actions\"\u003e\u003cimg src=\"https://github.com/vanillaes/mock-console/workflows/Latest/badge.svg\" alt=\"Latest Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/vanillaes/mock-console/actions\"\u003e\u003cimg src=\"https://github.com/vanillaes/mock-console/workflows/Release/badge.svg\" alt=\"Release Status\"\u003e\u003c/a\u003e\n\n  \u003ca href=\"https://discord.gg/aSWYgtybzV\"\u003e\u003cimg alt=\"Discord\" src=\"https://img.shields.io/discord/723296249121603604?color=%23738ADB\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n## Features\n\n- ECMAScript Module\n- Typescript Compatible\n\n## Imports\n\nThis package works isomorphically in browser and server-side JavaScript\n\n### Browser\n\nImport directly from the local path or a CDN\n\n```html\n\u003cscript type=\"module\"\u003e\nimport { MockConsole } from 'path/to/mock-console/index.js'\n\u003c/script\u003e\n```\n\nThe minified version can be imported from\n\n```html\n\u003cscript type=\"module\"\u003e\nimport { MockConsole } from 'path/to/mock-console/index.min.js'\n\u003c/script\u003e\n```\n\n### Node\n\nInstall the package\n\n```sh\nnpm install @vanillaes/mock-console\n```\n\nImport using the module path\n\n```javascript\nimport { MockConsole } from '@vanillaes/mock-console'\n```\n\n## Usage\n\n### Creation\n\n```const logger = new MockConsole()```\n\n*Note: The mock is a singleton. Every time `new` is called on the mock it'll return the same instance*\n\n### MockConsole.disable()\n\nDisables the built-in console methods (ie `log`, `info`, `error`)\n\n```javascript\nconst logger = new MockConsole();\nlogger.disable();\nconsole.log('This will NOT print to the console');\n```\n\n### MockConsole.restore()\n\nRestores the built-in console methods after they've been disabled\n\n```javascript\nconst logger = new MockConsole();\nlogger.disable();\nconsole.log('This will NOT print to the console');\nlogger.restore();\nconsole.log('This WILL print to the console');\n\u003e This WILL print to the console\n```\n\n### MockConsole.capture()\n\nCapture is used to store the console output so it can be retrieved later for testing\n\n```javascript\nconst logger = new MockConsole();\nlogger.capture();\nconsole.log('This message will be captured');\nlogger.restore();\nconsole.log(logger.logs);\n\u003e [ 'This message will be captured' ]\n```\n\nCaptured logs are stored in an array\n- `console.log` -\u003e `MockConsole.logs[]`\n- `console.info` -\u003e `MockConsole.infos[]`\n- `console.error` -\u003e `MockConsole.errors[]`\n\n### MockConsole.flush()\n\nFlush removes all previously captured logs\n\n```javascript\nconst logger = new MockConsole();\nlogger.capture();\nconsole.log('This message will be captured');\nlogger.restore();\nconsole.log(logger.logs);\n\u003e [ 'This message will be captured' ]\nlogger.flush();\nconsole.log(logger.logs);\n\u003e []\n```\n\n## Typings\n\nTypings are generated from JSDoc using Typescript. They are 100% compatible with VSCode Intellisense and will work seamlessly with Typescript.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanillaes%2Fmock-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanillaes%2Fmock-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanillaes%2Fmock-console/lists"}