{"id":16682609,"url":"https://github.com/jchip/xstdout","last_synced_at":"2025-03-13T11:18:06.330Z","repository":{"id":57402317,"uuid":"94351216","full_name":"jchip/xstdout","owner":"jchip","description":"capture stdout","archived":false,"fork":false,"pushed_at":"2017-06-14T18:39:46.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-21T16:48:45.348Z","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/jchip.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":"2017-06-14T16:25:26.000Z","updated_at":"2017-11-18T00:06:04.000Z","dependencies_parsed_at":"2022-09-26T17:01:03.469Z","dependency_job_id":null,"html_url":"https://github.com/jchip/xstdout","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fxstdout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fxstdout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fxstdout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchip%2Fxstdout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchip","download_url":"https://codeload.github.com/jchip/xstdout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243392326,"owners_count":20283565,"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-10-12T14:08:04.664Z","updated_at":"2025-03-13T11:18:06.310Z","avatar_url":"https://github.com/jchip.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]\n[![Dependency Status][daviddm-image]][daviddm-url] [![devDependency Status][daviddm-dev-image]][daviddm-dev-url]\n\n# xstdout\n\ncapture stdout\n\n# Usage\n\nExample:\n\n```js\nconst xstdout = require(\"xstdout\");\n\nconst intercept = xstdout.intercept(true);\n\nconsole.log(\"hello, world\");\n\nintercept.restore();\n\nexpect(intercept.stdout[0]).to.equal(\"hello, world\\n\");\n```\n\n## APIs\n\n### `xstdout.intercept(silent, [silentErr])`\n\nReturns an object:\n\n```js\n{\n  restore,\n  stdout,\n  stderr\n}\n```\n\n-   `stdout`/`stderr` are arrays of strings that captured stdout/stderr\n-   `restore` is a function that restores the original stdout/stderr\n\n#### Params\n\n-   `silent` - if `true`, then omit actual output to console and only capture\n-   `silentErr` - if not `undefined`, then independently controls output of stderr to console\n\n[travis-image]: https://travis-ci.org/jchip/xstdout.svg?branch=master\n\n[travis-url]: https://travis-ci.org/jchip/xstdout\n\n[npm-image]: https://badge.fury.io/js/xstdout.svg\n\n[npm-url]: https://npmjs.org/package/xstdout\n\n[daviddm-image]: https://david-dm.org/jchip/xstdout/status.svg\n\n[daviddm-url]: https://david-dm.org/jchip/xstdout\n\n[daviddm-dev-image]: https://david-dm.org/jchip/xstdout/dev-status.svg\n\n[daviddm-dev-url]: https://david-dm.org/jchip/xstdout?type=dev\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchip%2Fxstdout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchip%2Fxstdout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchip%2Fxstdout/lists"}