jscrambler
Advanced tools
Comparing version 0.5.4 to 0.5.5
@@ -16,2 +16,3 @@ /** | ||
var Q = require('q'); | ||
var temp = require('temp').track(); | ||
@@ -114,3 +115,2 @@ exports = module.exports = | ||
client.post('/code.json', params, function (err, res, body) { | ||
this.cleanZipProject(); | ||
try { | ||
@@ -208,8 +208,2 @@ if (err) deferred.reject(err); | ||
/** | ||
* It cleans the temporary zip project. | ||
*/ | ||
cleanZipProject: function () { | ||
fs.unlinkSync('.tmp.zip'); | ||
}, | ||
/** | ||
* It zips all files inside the passed parameter into a single zip file. It | ||
@@ -223,3 +217,3 @@ * accepts an optional `cwd` parameter. | ||
hasFiles = true; | ||
fs.outputFileSync('.tmp.zip', fs.readFileSync(files[0])); | ||
fs.outputFileSync(temp.openSync({suffix: '.zip'}).path, fs.readFileSync(files[0])); | ||
} else { | ||
@@ -261,4 +255,5 @@ var zip = new JSZip(); | ||
if (hasFiles) { | ||
fs.outputFileSync('.tmp.zip', zip.generate({type: 'nodebuffer'}), {encoding: 'base64'}); | ||
files[0] = '.tmp.zip'; | ||
var tempFile = temp.openSync({suffix: '.zip'}); | ||
fs.outputFileSync(tempFile.path, zip.generate({type: 'nodebuffer'}), {encoding: 'base64'}); | ||
files[0] = tempFile.path; | ||
files.length = 1; | ||
@@ -265,0 +260,0 @@ } else { |
{ | ||
"name": "jscrambler", | ||
"description": "JScrambler API client.", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"homepage": "https://github.com/auditmark/node-jscrambler", | ||
@@ -27,9 +27,10 @@ "author": { | ||
"dependencies": { | ||
"q": "^1.0.1", | ||
"lodash": "^2.4.1", | ||
"needle": "^0.6.6", | ||
"commander": "^2.1.0", | ||
"fs-extra": "^0.8.1", | ||
"glob": "^4.0.2", | ||
"jszip": "^2.2.2", | ||
"glob": "^4.0.2" | ||
"lodash": "^2.4.1", | ||
"needle": "^0.6.6", | ||
"q": "^1.0.1", | ||
"temp": "^0.8.1" | ||
}, | ||
@@ -36,0 +37,0 @@ "main": "jscrambler", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25799
8
469
+ Addedtemp@^0.8.1
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrimraf@2.6.3(transitive)
+ Addedtemp@0.8.4(transitive)