Installations
npm install spawn-to-readstream
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>= 0.8.0
NPM Version
1.3.14
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
alessioalex
Download Statistics
Total Downloads
6,751,119
Last Day
4,060
Last Week
6,317
Last Month
75,354
Last Year
1,161,277
GitHub Statistics
6 Stars
7 Commits
1 Forks
3 Watching
1 Branches
1 Contributors
Bundle Size
18.63 kB
Minified
5.59 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.1.3
Package Id
spawn-to-readstream@0.1.3
Size
3.08 kB
NPM Version
1.3.14
Publised On
21 May 2014
Total Downloads
Cumulative downloads
Total Downloads
6,751,119
Last day
-32.4%
4,060
Compared to previous day
Last week
-73.8%
6,317
Compared to previous week
Last month
18.2%
75,354
Compared to previous month
Last year
-3.8%
1,161,277
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Dev Dependencies
1
spawn-to-readstream
Description
Make child process spawn behave like a read stream (buffer the error, don't emit end if error emitted).
Installation
1npm install spawn-to-readstream
Examples
1var toReadStream = require('spawn-to-readstream'), 2 spawn = require('child_process').spawn; 3 4toReadStream(spawn('ls', ['-lah'])).on('error', function(err) { 5 throw err; 6}).on('end', function() { 7 console.log('~~~ DONE ~~~'); 8}).on('data', function(data) { 9 console.log('ls data :::', data.toString()); 10});
Limiting the output of the steam
1var toReadStream = require('../index'), 2 spawn = require('child_process').spawn, 3 limit, buf; 4 5buf = 0; 6limit = 100 * 1024; // 100 Kb 7 8// Note that it's a 'soft' limit, meaning the data you 9// receive might be > 100 Kb, because the child process 10// was stopped after receiving more than <LIMIT> bytes 11toReadStream(spawn('cat', ['/dev/urandom']), limit) 12 .on('error', function(err) { 13 throw err; 14 }).on('end', function(isLimited) { 15 console.log('done, ' + buf + ' bytes received'); 16 if (isLimited) { 17 console.log('child process was cut'); 18 } 19 }).on('data', function(data) { 20 buf += data.length; 21 });
Tests
1npm test
License
MIT
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
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
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More