{"id":15506735,"url":"https://github.com/manovotny/execa-output","last_synced_at":"2025-03-24T23:49:41.891Z","repository":{"id":142410397,"uuid":"142943420","full_name":"manovotny/execa-output","owner":"manovotny","description":"A utility to display command output when using execa with listr.","archived":false,"fork":false,"pushed_at":"2019-09-08T21:07:21.000Z","size":682,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T03:13:53.714Z","etag":null,"topics":["child-process","command","execa","listr","observable","output","process","task"],"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/manovotny.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-31T00:51:29.000Z","updated_at":"2022-06-04T05:43:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"08c9bcee-1e47-414c-98f4-a7dfbd1124b6","html_url":"https://github.com/manovotny/execa-output","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manovotny%2Fexeca-output","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manovotny%2Fexeca-output/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manovotny%2Fexeca-output/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manovotny%2Fexeca-output/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manovotny","download_url":"https://codeload.github.com/manovotny/execa-output/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245372367,"owners_count":20604490,"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":["child-process","command","execa","listr","observable","output","process","task"],"created_at":"2024-10-02T09:28:55.104Z","updated_at":"2025-03-24T23:49:41.865Z","avatar_url":"https://github.com/manovotny.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# execa-output\n\n\u003e A utility to display command output when using [execa](https://www.npmjs.com/package/execa) with [listr](https://www.npmjs.com/package/listr).\n\n`execa-output` is responsible for creating the output sub text, like `→ text`, as seen in the screenshot below.\n\n![Screenshot](assets/demo.gif)\n\n## Install\n\n### NPM\n\n```\n$ npm i execa-output\n```\n\n### Yarn\n\n```\n$ yarn add execa-output\n```\n\n## Usage\n\nBasic usage is exactly the same as using `execa`.\n\n```js\nconst execa = require('execa');\nconst execao = require('execa-output');\nconst Listr = require('listr');\n\nconst tasks = new Listr([\n    {\n        task: () =\u003e execa('some', ['command']),\n        title: 'Comamnd without output or output you do not care to show'\n    },\n    {\n        task: () =\u003e execao('some', ['other', 'command']),\n        title: 'Command with output you want to show'\n    }\n]);\n\ntasks.run().catch((error) =\u003e {\n    console.error(error);\n});\n```\n\nYou can also pass in options to `execa`, just like when using `execa` directly.\n\n```js\nconst execao = require('execa-output');\n\nconst options = {};\n\nexecao('some', ['command'], options);\n```\n\nLastly, you can also provide a callback when you need access to the commnand output.\n\n```js\nconst execao = require('execa-output');\n\nexecao('some', ['command'], null, (result) =\u003e {\n    console.log('command output:', value);\n});\n```\n\n## Credit\n\nI use [np](https://github.com/sindresorhus/np) to release npm packages and I have always :heart: it's simple, elegant presentation. It's how I learned about [execa](https://github.com/sindresorhus/execa) and [listr](https://github.com/SamVerschueren/listr), which I now use to build a lot of my own, custom [npm scripts](https://docs.npmjs.com/misc/scripts).\n\nThere's [an issue on listr](https://github.com/SamVerschueren/listr/issues/90) where people wanted to know how to display long running task output and [it was recommended](https://github.com/SamVerschueren/listr/issues/90#issuecomment-382702459) that one could reimplement / resue [the code np uses](https://github.com/sindresorhus/np/blob/5d923655a3986d04ea14035d20d5c0c16964b7fe/index.js#L17-L25).\n\nThis is exactly why `execa-output` was created.\n\nAll credit for this code goes to [@sindresorhus](https://github.com/sindresorhus) and [@SamVerschueren](https://github.com/SamVerschueren) for the original implementation. :pray:\n\nI simply modularized it for reuse.\n\n## License\n\nMIT © [Michael Novotny](https://manovotny.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanovotny%2Fexeca-output","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanovotny%2Fexeca-output","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanovotny%2Fexeca-output/lists"}