{"_id":"stdin-discarder","_rev":"4122607","name":"stdin-discarder","description":"Discard stdin input except for Ctrl+C","dist-tags":{"latest":"0.3.1"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-02-24T19:25:48.000Z","created":"2022-07-26T14:16:08.355Z","0.3.1":"2026-01-08T17:15:54.588Z","0.3.0":"2025-11-04T18:14:15.588Z","0.2.2":"2024-01-06T09:21:37.285Z","0.2.1":"2023-12-23T11:33:52.817Z","0.2.0":"2023-12-15T03:13:02.996Z","0.1.0":"2022-07-26T14:16:08.355Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/stdin-discarder.git"},"versions":{"0.3.1":{"name":"stdin-discarder","version":"0.3.1","description":"Discard stdin input except for Ctrl+C","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/stdin-discarder.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stdin","process","standard","discard","ignore","input"],"devDependencies":{"ava":"^6.0.1","tsd":"^0.29.0","xo":"^0.56.0"},"gitHead":"59c3f40b554d7af21c8a3917b3485956c8d57004","types":"./index.d.ts","_id":"stdin-discarder@0.3.1","bugs":{"url":"https://github.com/sindresorhus/stdin-discarder/issues"},"homepage":"https://github.com/sindresorhus/stdin-discarder#readme","_nodeVersion":"24.12.0","_npmVersion":"11.6.1","dist":{"shasum":"92a1e741e709248865d0562bb7babe84d350ae6a","size":2234,"noattachment":false,"key":"/stdin-discarder/-/stdin-discarder-0.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stdin-discarder/download/stdin-discarder-0.3.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stdin-discarder_0.3.1_1767892554442_0.38160583140063564"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-01-08T17:15:54.588Z","publish_time":1767892554588,"_source_registry_name":"default","_cnpm_publish_time":1767892554588},"0.3.0":{"name":"stdin-discarder","version":"0.3.0","description":"Discard stdin input except for Ctrl+C","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/stdin-discarder.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stdin","process","standard","discard","ignore","input"],"devDependencies":{"ava":"^6.0.1","tsd":"^0.29.0","xo":"^0.56.0"},"gitHead":"be4e918a52194e8c77adad9b8e15734ae768d9e1","types":"./index.d.ts","_id":"stdin-discarder@0.3.0","bugs":{"url":"https://github.com/sindresorhus/stdin-discarder/issues"},"homepage":"https://github.com/sindresorhus/stdin-discarder#readme","_nodeVersion":"20.19.5","_npmVersion":"11.6.1","dist":{"shasum":"8d1da878b407a9a4818e704c10701204900456f9","size":2239,"noattachment":false,"key":"/stdin-discarder/-/stdin-discarder-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stdin-discarder/download/stdin-discarder-0.3.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stdin-discarder_0.3.0_1762280055403_0.3617932566223958"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-04T18:14:15.588Z","publish_time":1762280055588,"_source_registry_name":"default","_cnpm_publish_time":1762280055588},"0.2.2":{"name":"stdin-discarder","version":"0.2.2","description":"Discard stdin input except for Ctrl+C","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/stdin-discarder.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stdin","process","standard","discard","ignore","input"],"devDependencies":{"ava":"^6.0.1","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"329c85219534b7e1f6272a3f15c4daa8f05d04a4","bugs":{"url":"https://github.com/sindresorhus/stdin-discarder/issues"},"homepage":"https://github.com/sindresorhus/stdin-discarder#readme","_id":"stdin-discarder@0.2.2","_nodeVersion":"21.5.0","_npmVersion":"9.2.0","dist":{"shasum":"390037f44c4ae1a1ae535c5fe38dc3aba8d997be","size":2072,"noattachment":false,"key":"/stdin-discarder/-/stdin-discarder-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/stdin-discarder/download/stdin-discarder-0.2.2.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stdin-discarder_0.2.2_1704532897103_0.993761095839552"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-01-06T09:21:37.285Z","publish_time":1704532897285,"_source_registry_name":"default","_cnpm_publish_time":1704532897285},"0.2.1":{"name":"stdin-discarder","version":"0.2.1","description":"Discard stdin input except for Ctrl+C","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/stdin-discarder.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stdin","process","standard","discard","ignore","input"],"devDependencies":{"ava":"^6.0.1","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"013764f81c717f0e8256e7f6a46a72e6ea8fd416","bugs":{"url":"https://github.com/sindresorhus/stdin-discarder/issues"},"homepage":"https://github.com/sindresorhus/stdin-discarder#readme","_id":"stdin-discarder@0.2.1","_nodeVersion":"21.2.0","_npmVersion":"9.2.0","dist":{"shasum":"e69966d2ac1e803f6378584aa7f30a74e01d70ce","size":2064,"noattachment":false,"key":"/stdin-discarder/-/stdin-discarder-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stdin-discarder/download/stdin-discarder-0.2.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stdin-discarder_0.2.1_1703331232584_0.26992939601435584"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-23T11:33:52.817Z","publish_time":1703331232817,"_source_registry_name":"default","_cnpm_publish_time":1703331232817},"0.2.0":{"name":"stdin-discarder","version":"0.2.0","description":"Discard stdin input except for Ctrl+C","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/stdin-discarder.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stdin","process","standard","discard","ignore","input"],"devDependencies":{"ava":"^6.0.1","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"65f4ccf52e3950fe05d739cff72aa17b4465fd77","bugs":{"url":"https://github.com/sindresorhus/stdin-discarder/issues"},"homepage":"https://github.com/sindresorhus/stdin-discarder#readme","_id":"stdin-discarder@0.2.0","_nodeVersion":"18.19.0","_npmVersion":"9.2.0","dist":{"shasum":"97299ec59581dae5b9625a23b1d1fdf3b83a367e","size":2053,"noattachment":false,"key":"/stdin-discarder/-/stdin-discarder-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stdin-discarder/download/stdin-discarder-0.2.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stdin-discarder_0.2.0_1702609982755_0.2511791731786057"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-15T03:13:02.996Z","publish_time":1702609982996,"_source_registry_name":"default","_cnpm_publish_time":1702609982996},"0.1.0":{"name":"stdin-discarder","version":"0.1.0","description":"Discard stdin input except for Ctrl+C","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/stdin-discarder.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["stdin","process","standard","discard","ignore","input"],"dependencies":{"bl":"^5.0.0"},"devDependencies":{"ava":"^4.3.0","hook-std":"^3.0.0","tsd":"^0.21.0","xo":"^0.50.0"},"gitHead":"a367682430700a0528905b7dda045f1dbf87a3b8","bugs":{"url":"https://github.com/sindresorhus/stdin-discarder/issues"},"homepage":"https://github.com/sindresorhus/stdin-discarder#readme","_id":"stdin-discarder@0.1.0","_nodeVersion":"18.4.0","_npmVersion":"8.3.2","dist":{"shasum":"22b3e400393a8e28ebf53f9958f3880622efde21","size":2404,"noattachment":false,"key":"/stdin-discarder/-/stdin-discarder-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stdin-discarder/download/stdin-discarder-0.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stdin-discarder_0.1.0_1658844968168_0.28395172603421215"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-26T14:21:10.581Z","publish_time":1658844968355,"_cnpm_publish_time":1658844968355}},"readme":"# stdin-discarder\n\n> Discard stdin input except for Ctrl+C\n\nThis can be useful to prevent stdin input from interfering with stdout output. For example, you are showing a spinner, and if the user presses a key, it would interfere with the spinner, causing visual glitches. This package prevents such problems.\n\nThis has no effect on Windows as there is no good way to implement discarding stdin properly there.\n\nThis package is used by [`ora`](https://github.com/sindresorhus/ora) for its [`discardStdin`](https://github.com/sindresorhus/ora#discardstdin) option.\n\n## Install\n\n```sh\nnpm install stdin-discarder\n```\n\n## Usage\n\n```js\nimport stdinDiscarder from 'stdin-discarder';\n\nstdinDiscarder.start();\n```\n\n## API\n\n### stdinDiscarder.start()\n\nStart discarding stdin.\n\n### stdinDiscarder.stop()\n\nStop discarding stdin.\n\n## Related\n\n- [hook-std](https://github.com/sindresorhus/hook-std) - Hook and modify stdout and stderr\n","_attachments":{},"homepage":"https://github.com/sindresorhus/stdin-discarder#readme","bugs":{"url":"https://github.com/sindresorhus/stdin-discarder/issues"},"license":"MIT"}