Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

git-spawned-stream

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-spawned-stream - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

4

example.js

@@ -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);

@@ -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);
};
{
"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",

@@ -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);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc