+4
-1
@@ -5,3 +5,3 @@ var crypto = require('crypto'), | ||
| exports.shasum = function(basepath) { | ||
| exports.shasum = function(basepath, opts) { | ||
| var manifests = [ | ||
@@ -14,2 +14,5 @@ basepath + '/npm-shrinkwrap.json', | ||
| if (opts.production) | ||
| manifests.push(['production: true']) | ||
| if (manifests.length === 0) | ||
@@ -16,0 +19,0 @@ throw new Error('Cannot find any manifest files (package.json or npm-shrinkwrap.json)'); |
+1
-1
@@ -16,3 +16,3 @@ var fs = require('fs'), | ||
| this.shasum = manifest.shasum(this.basepath); | ||
| this.shasum = manifest.shasum(this.basepath, this.opts); | ||
| this.path = this.opts.storage + '/' + this.shasum + '.tar'; | ||
@@ -19,0 +19,0 @@ }; |
+1
-1
| { | ||
| "name": "inst", | ||
| "version": "0.1.4", | ||
| "version": "0.2.0", | ||
| "dependencies": { | ||
@@ -5,0 +5,0 @@ "npm": "~1.4.0", |
+1
-5
@@ -36,6 +36,2 @@ node-inst | ||
| -t, --ttl [second] cache lifetime [86400] | ||
| ## Limitations | ||
| Doesn't work on Windows platform (uses system's `tar` tool) | ||
| -p, --production production mode, do not install dev dependencies [false] |
@@ -10,5 +10,10 @@ var assert = require('assert'), | ||
| it('should return check sum', function() { | ||
| assert.equal(manifest.shasum(__dirname + '/files/module'), '7d272278fae80d6da9680bef7fb7b92adba46466') | ||
| assert.equal(manifest.shasum(__dirname + '/files/module', {}), '7d272278fae80d6da9680bef7fb7b92adba46466') | ||
| }); | ||
| it('should return check sum (production)', function() { | ||
| assert.equal(manifest.shasum(__dirname + '/files/module', {production: true}), | ||
| 'd4f1f2e7336ba825047cfd679ef90745353e964d') | ||
| }); | ||
| it('should return error when no manifests can be found', function() { | ||
@@ -15,0 +20,0 @@ assert.throws(function() { |
Sorry, the diff of this file is not supported yet
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances 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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
15473
2.57%288
2.13%37
-9.76%