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

jscrambler

Package Overview
Dependencies
Maintainers
6
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscrambler - npm Package Compare versions

Comparing version 1.3.3 to 1.3.5

dist/bin/jscrambler.js

23

Gruntfile.js

@@ -1,2 +0,2 @@

module.exports = function (grunt) {
module.exports = function(grunt) {
grunt.initConfig({

@@ -8,8 +8,10 @@ babel: {

dist: {
files: [{
files: [
{
expand: true,
cwd: 'src/lib',
cwd: 'src',
src: '**/*.js',
dest: 'dist/lib'
}, {
dest: 'dist'
},
{
expand: true,

@@ -19,3 +21,4 @@ cwd: 'src/bin',

dest: 'dist/bin'
}]
}
]
}

@@ -30,5 +33,5 @@ },

expand: true,
cwd: 'src/lib',
cwd: 'src',
src: ['**/*', '!**/*.js'],
dest: 'dist/lib'
dest: 'dist'
}

@@ -51,4 +54,4 @@ },

files: 'src/**/*',
tasks: ['build']
},
tasks: ['build']
}
}

@@ -55,0 +58,0 @@ });

{
"name": "jscrambler",
"description": "Jscrambler API client.",
"version": "1.3.3",
"homepage": "https://github.com/jscrambler/javascript-jscrambler",
"version": "1.3.5",
"homepage": "https://github.com/jscrambler/jscrambler",
"author": {

@@ -12,6 +12,6 @@ "name": "magalhas",

"type": "git",
"url": "https://github.com/jscrambler/javascript-jscrambler.git"
"url": "https://github.com/jscrambler/jscrambler.git"
},
"bugs": {
"url": "https://github.com/jscrambler/javascript-jscrambler/issues"
"url": "https://github.com/jscrambler/jscrambler/issues"
},

@@ -25,3 +25,4 @@ "licenses": [

"scripts": {
"build": "grunt build && chmod +x dist/bin/jscrambler",
"clean": "rm -rf ./dist",
"build": "babel src --out-dir dist",
"test": "grunt test 2> /dev/null",

@@ -32,7 +33,6 @@ "watch": "grunt watch",

"engines": {
"node": ">= 0.8.0"
"node": ">= 6.10.0"
},
"dependencies": {
"axios": "^0.13.1",
"babel-polyfill": "^6.9.1",
"commander": "^2.8.1",

@@ -45,2 +45,3 @@ "flavored-path": "0.0.8",

"lodash.clone": "^4.0.3",
"lodash.clonedeep": "^4.5.0",
"lodash.defaults": "^4.0.1",

@@ -57,8 +58,7 @@ "lodash.keys": "^4.0.1",

"devDependencies": {
"babel": "^6.5.2",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-0": "^6.5.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"grunt": "^1.0.1",
"grunt-babel": "^6.0.0",
"grunt-cli": "^1.2.0",

@@ -70,4 +70,6 @@ "grunt-contrib-clean": "^1.0.0",

},
"main": "dist/lib/index",
"bin": "dist/bin/jscrambler"
"main": "dist/index.js",
"bin": {
"jscrambler": "dist/bin/jscrambler.js"
}
}

@@ -216,3 +216,3 @@ # ![jscrambler](https://rawgithub.com/jscrambler/javascript-jscrambler/master/media/jscrambler-logo.png)

More detailed informations can be found [here](https://docs.jscrambler.com/api/clients.html).
More detailed informations can be found [here](https://docs.jscrambler.com/code-integrity/documentation/api/clients).

@@ -219,0 +219,0 @@ ## JScrambler Parameters

/* global describe, beforeEach, it, expect, spyOn, Buffer, jasmine, console */
var fs = require('fs');
var jScrambler = require('../../jscrambler');
var jScramblerKeys = require('../../jscrambler_keys');
var pluck = require('lodash.pluck');
var util = require('util');
const fs = require('fs');
const jScrambler = require('../../jscrambler');
const jScramblerKeys = require('../../jscrambler_keys');
const pluck = require('lodash.pluck');
const util = require('util');
describe('JScrambler Client', function () {
var jScramblerClient, projectId, downloadedBuffer;
describe('JScrambler Client', () => {
let jScramblerClient, projectId, downloadedBuffer;
beforeEach(function () {
beforeEach(() => {
jScramblerClient = new jScrambler.Client({

@@ -20,5 +20,3 @@ accessKey: jScramblerKeys.accessKey,

test('Single file', [
'test/fixtures/single-file/index.js'
]);
test('Single file', ['test/fixtures/single-file/index.js']);
test('Multiple files', [

@@ -35,11 +33,11 @@ 'test/fixtures/multiple-files/index.html',

function test (testName, files) {
it(testName + ': uploads code', function (done) {
var zipSpy = spyOn(jScrambler, 'zipProject').andCallThrough();
function test(testName, files) {
it(`${testName}: uploads code`, done => {
const zipSpy = spyOn(jScrambler, 'zipProject').andCallThrough();
jScrambler
.uploadCode(jScramblerClient, {
files: files
files
})
.then(function (res) {
.then(res => {
expect(zipSpy).toHaveBeenCalled();

@@ -50,4 +48,6 @@ expect(res.id).toBeDefined();

expect(res.sources.length).toEqual(files.length);
for (var i = 0, l = files.length; i < l; ++i) {
expect(pluck(res.sources, 'filename').indexOf(files[i]) !== -1).toBeTruthy();
for (let i = 0, l = files.length; i < l; ++i) {
expect(
pluck(res.sources, 'filename').indexOf(files[i]) !== -1
).toBeTruthy();
}

@@ -57,3 +57,3 @@

})
.catch(function (error) {
.catch(error => {
console.log(util.inspect(error));

@@ -64,3 +64,3 @@ })

it(testName + ': gets project info', function (done) {
it(`${testName}: gets project info`, done => {
expect(projectId).toBeDefined();

@@ -70,3 +70,3 @@

.getInfo(jScramblerClient, projectId)
.then(function (res) {
.then(res => {
expect(res.error_id).toEqual(null);

@@ -76,8 +76,10 @@ expect(res.extension).toEqual('zip');

expect(res.sources.length).toEqual(files.length);
for (var i = 0, l = files.length; i < l; ++i) {
expect(pluck(res.sources, 'filename').indexOf(files[i]) !== -1).toBeTruthy();
for (let i = 0, l = files.length; i < l; ++i) {
expect(
pluck(res.sources, 'filename').indexOf(files[i]) !== -1
).toBeTruthy();
expect(res.sources[i].error_id).toEqual(null);
}
})
.catch(function (error) {
.catch(error => {
console.log(util.inspect(error));

@@ -88,3 +90,3 @@ })

it(testName + ': polls project', function (done) {
it(`${testName}: polls project`, done => {
expect(projectId).toBeDefined();

@@ -94,3 +96,3 @@

.pollProject(jScramblerClient, projectId)
.then(function (res) {
.then(res => {
expect(res.error_id).toEqual('0');

@@ -100,10 +102,12 @@ expect(res.finished_at).toBeDefined();

expect(res.sources.length).toEqual(files.length);
for (var i = 0, l = files.length; i < l; ++i) {
expect(pluck(res.sources, 'filename').indexOf(files[i]) !== -1).toBeTruthy();
for (let i = 0, l = files.length; i < l; ++i) {
expect(
pluck(res.sources, 'filename').indexOf(files[i]) !== -1
).toBeTruthy();
}
var finishedAt = new Date(res.finished_at);
const finishedAt = new Date(res.finished_at);
expect(finishedAt instanceof Date).toBeTruthy();
})
.catch(function (error) {
.catch(error => {
console.log(util.inspect(error));

@@ -114,3 +118,3 @@ })

it(testName + ': downloads code', function (done) {
it(`${testName}: downloads code`, done => {
expect(projectId).toBeDefined();

@@ -120,7 +124,7 @@

.downloadCode(jScramblerClient, projectId)
.then(function (res) {
.then(res => {
expect(Buffer.isBuffer(res)).toBeTruthy();
downloadedBuffer = res;
})
.catch(function (error) {
.catch(error => {
console.log(util.inspect(error));

@@ -131,12 +135,12 @@ })

it(testName + ': unzips the project', function () {
it(`${testName}: unzips the project`, () => {
expect(downloadedBuffer).toBeDefined();
jScrambler.unzipProject(downloadedBuffer, './results/');
for (var i = 0, l = files.length; i < l; ++i) {
expect(fs.existsSync('./results/' + files[i])).toBeTruthy();
for (let i = 0, l = files.length; i < l; ++i) {
expect(fs.existsSync(`./results/${files[i]}`)).toBeTruthy();
}
});
it(testName + ': processes', function (done) {
it(`${testName}: processes`, done => {
jScrambler

@@ -148,6 +152,6 @@ .process({

accessKey: jScramblerKeys.accessKey,
secretKey: jScramblerKeys.secretKey,
secretKey: jScramblerKeys.secretKey
}
})
.catch(function (error) {
.catch(error => {
console.log(util.inspect(error));

@@ -154,0 +158,0 @@ })

Sorry, the diff of this file is not supported yet

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