git-spawned-stream
Advanced tools
+2
-2
@@ -5,3 +5,3 @@ "use strict"; | ||
| var path = require('path'); | ||
| var repoPath = process.env.REPO || (__dirname + '.git'); | ||
| var repoPath = process.env.REPO || path.join(__dirname, '.git'); | ||
| repoPath = path.resolve(repoPath); | ||
@@ -21,3 +21,3 @@ var byteLimit = 5 * 1024 * 1024; // 5 Mb | ||
| }).on('error', function(err) { | ||
| console.error('An error occured:'); | ||
| console.error('An error occurred:'); | ||
| console.error('-----------------\n'); | ||
@@ -24,0 +24,0 @@ console.error(err.message); |
+10
-2
@@ -7,5 +7,12 @@ "use strict"; | ||
| module.exports = function(repoPath, args, limit) { | ||
| module.exports = function(repoPath, args, limit, gitCommand = 'git') { | ||
| var _args = ['--git-dir=' + repoPath]; | ||
| // The limit is a git bin path | ||
| if (typeof limit === 'string') { | ||
| debug('got string limit, using it as gitCommand and unsetting limit'); | ||
| gitCommand = limit; | ||
| limit = undefined; | ||
| } | ||
| args.forEach(function(item) { | ||
@@ -17,4 +24,5 @@ _args.push(item); | ||
| debug('limit', limit); | ||
| debug('gitCommand', gitCommand); | ||
| return run(spawn('git', _args), limit); | ||
| return run(spawn(gitCommand, _args), limit); | ||
| }; |
+1
-1
| { | ||
| "name": "git-spawned-stream", | ||
| "version": "0.1.1", | ||
| "version": "1.0.0", | ||
| "description": "Create a readable stream from a spawned git process.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+4
-3
@@ -8,3 +8,3 @@ # git-spawned-stream | ||
| ```js | ||
| gitSpawnedStream(repoPath, spawnArguments, limitInBytes) | ||
| gitSpawnedStream(repoPath, spawnArguments, limitInBytes, gitBinary) | ||
| ``` | ||
@@ -17,2 +17,3 @@ | ||
| - `limitInBytes` - kill the process if it exceeds the imposed limit (sends more data than allowed) | ||
| - `gitBinary` - path to the git binary to use (use the one in `PATH` by default) | ||
@@ -24,3 +25,3 @@ Example: | ||
| var path = require('path'); | ||
| var repoPath = process.env.REPO || (__dirname + '.git'); | ||
| var repoPath = process.env.REPO || path.join(__dirname, '.git'); | ||
| repoPath = path.resolve(repoPath); | ||
@@ -40,3 +41,3 @@ var byteLimit = 5 * 1024 * 1024; // 5 Mb | ||
| }).on('error', function(err) { | ||
| console.error('An error occured:'); | ||
| console.error('An error occurred:'); | ||
| console.error('-----------------\n'); | ||
@@ -43,0 +44,0 @@ console.error(err.message); |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4376
9.1%68
11.48%0
-100%51
2%2
100%