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

crex

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crex - npm Package Compare versions

Comparing version 0.2.2 to 0.3.0

banner.txt

6

lib/crex.js

@@ -24,2 +24,8 @@ var api = require('./api');

break;
case 'POST':
req = request.doPost;
break;
case 'DELETE':
req = request.doDelete;
break;
}

@@ -26,0 +32,0 @@

44

lib/request.js

@@ -5,11 +5,41 @@ var request = require('superagent');

return new Promise(function (resolve, reject) {
request.get(url).end(function (err, res) {
if (err) reject(err);
resolve(res.body);
});
})
}
request
.get(url)
.query(args)
.end(function (err, res) {
if (err) reject(err);
resolve(res.body);
});
});
};
var doPost = function(url, args) {
return new Promise(function (resolve, reject) {
request
.post(url)
.type('form')
.send(args)
.end(function (err, res) {
if (err) reject(err);
resolve(res.body);
});
});
};
var doDelete = function(url, args) {
return new Promise(function (resolve, reject) {
request
.delete(url)
.query(args)
.end(function (err, res) {
if (err) reject(err);
resolve(res.body);
});
});
};
module.exports = {
doGet: doGet
doGet: doGet,
doPost: doPost,
doDelete: doDelete
};

8

package.json
{
"name": "crex",
"version": "0.2.2",
"version": "0.3.0",
"description": "Creative Exchange SDK for Javascript",

@@ -8,4 +8,8 @@ "author": "Mateusz Luczak <mateusz.luczak@outlook.com>",

"main": "dist/crex.js",
"module": "dist/crex.es.js",
"jsnext:main": "dist/crex.es.js",
"scripts": {
"build": "rollup -c",
"build": "npm run build:module && npm run build:browser",
"build:module": "rollup -c",
"build:browser": "rollup -c rollup.config.browser.js",
"test": "mocha test/**"

@@ -12,0 +16,0 @@ },

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

var fs = require('fs');
var commonjs = require('rollup-plugin-commonjs');

@@ -5,6 +6,14 @@ var resolve = require('rollup-plugin-node-resolve');

var pkg = JSON.parse(fs.readFileSync( 'package.json', 'utf-8'));
var banner = fs.readFileSync('banner.txt', 'utf-8')
.replace( '${version}', pkg.version);
module.exports = {
entry: 'lib/index.js',
dest: 'dist/crex-sdk.min.js',
format: 'iife',
targets: [
{ dest: 'dist/crex.js', format: 'cjs' },
{ dest: 'dist/crex.es.js', format: 'es' }
],
banner: banner,
moduleName: 'CrEx',

@@ -14,10 +23,5 @@ plugins: [

jsnext: true,
main: true,
browser: true
}),
commonjs({
sourceMap: false
}),
uglify()
main: true
})
]
};

@@ -23,2 +23,18 @@ var chai = require('chai');

});
describe('#getPackageStatus', function() {
it('should return list of packages', function() {
return expect(crex.exportGetPackageStatus({
'id': 'ae814a08-c438-429b-ab7a-fbd95dbe6998'
})).to.eventually.be.a('array');
});
});
describe('#deletePackage', function() {
it('should remove package', function() {
return expect(crex.exportRemovePackage({
'id': 'ae814a08-c438-429b-ab7a-fbd95dbe6998'
})).to.eventually.be.a('object');
});
});
});

@@ -23,2 +23,34 @@ var chai = require('chai');

});
describe('#getPackageStatus', function() {
it('should return list of packages', function() {
return expect(crex.importGetPackageStatus({
'id': '3c190d0a-91c3-4aa2-beaa-f17b5dbdd913'
})).to.eventually.be.a('array');
});
});
describe('#inspectPackage', function() {
it('should return status', function() {
return expect(crex.importInspectPackage({
'id': '3c190d0a-91c3-4aa2-beaa-f17b5dbdd913'
})).to.eventually.be.a('object');
});
});
describe('#installPackage', function() {
it('should return status', function() {
return expect(crex.importInstallPackage({
'id': '3c190d0a-91c3-4aa2-beaa-f17b5dbdd913'
})).to.eventually.be.a('object');
});
});
describe('#deletePackage', function() {
it('should remove package', function() {
return expect(crex.importRemovePackage({
'id': '3c190d0a-91c3-4aa2-beaa-f17b5dbdd913'
})).to.eventually.be.a('object');
});
});
});
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