Socket
Socket
Sign inDemoInstall

anvil.cdnjs

Package Overview
Dependencies
47
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.0.3

40

lib/plugin.js

@@ -45,2 +45,5 @@ var request = require( "request" );

if ( _.isArray(this.packageName) ) {
this.packageName = this.packageName.pop();
}

@@ -59,10 +62,10 @@ request( this.url, function( err, response, body ) {

}.bind(this));
if( typeof pkg === "undefined" ) {
anvil.log.error( "anvil.cdnjs: No library with named: " + this.packageName + " exists on cdnjs." );
anvil.raise( "all.stop", 0 );
anvil.raise( "all.stop", 0 );
done();
return;
return;
}
url = this.baseUrl + pkg.name + "/" + pkg.version + "/" + pkg.filename;

@@ -87,3 +90,3 @@ this.pkg = pkg;

});
anvil.raise( "all.stop", 0 );
anvil.raise( "all.stop", 0 );
done();

@@ -98,3 +101,4 @@ }

getPkg: function( err, response, body, done ) {
var target;
var target,
self = this;
anvil.fs.ensurePath( this.output, function( err ) {

@@ -113,8 +117,28 @@ if( err ) {

anvil.log.complete( this.pkg.filename + " has been installed to " + target );
//this.updatePackageList( done );
}.bind( this ));
}.bind( self ));
},
updatePackageList: function( done ) {
anvil.fs.ensurePath( ".anvil", function( err ) {
this._error( err, done );
anvil.fs.read( ".anvil/cdnjs.json", function( content, err ) {
this._error( err, done );
anvil.raise( "all.stop", 0 );
done();
anvil.raise( "all.stop", 0 );
}.bind( this ));
}.bind( this ));
},
_error: function( err, done ) {
if( err ) {
anvil.log.error( err );
done();
}
}

@@ -121,0 +145,0 @@ });

2

package.json
{
"name": "anvil.cdnjs",
"version": "0.0.2",
"version": "0.0.3",
"description": "Install packages from cdnjs.",

@@ -5,0 +5,0 @@ "repository": {

@@ -45,2 +45,5 @@ var request = require( "request" );

if ( _.isArray(this.packageName) ) {
this.packageName = this.packageName.pop();
}

@@ -59,10 +62,10 @@ request( this.url, function( err, response, body ) {

}.bind(this));
if( typeof pkg === "undefined" ) {
anvil.log.error( "anvil.cdnjs: No library with named: " + this.packageName + " exists on cdnjs." );
anvil.raise( "all.stop", 0 );
anvil.raise( "all.stop", 0 );
done();
return;
return;
}
url = this.baseUrl + pkg.name + "/" + pkg.version + "/" + pkg.filename;

@@ -87,3 +90,3 @@ this.pkg = pkg;

});
anvil.raise( "all.stop", 0 );
anvil.raise( "all.stop", 0 );
done();

@@ -98,3 +101,4 @@ }

getPkg: function( err, response, body, done ) {
var target;
var target,
self = this;
anvil.fs.ensurePath( this.output, function( err ) {

@@ -113,8 +117,28 @@ if( err ) {

anvil.log.complete( this.pkg.filename + " has been installed to " + target );
//this.updatePackageList( done );
}.bind( this ));
}.bind( self ));
},
updatePackageList: function( done ) {
anvil.fs.ensurePath( ".anvil", function( err ) {
this._error( err, done );
anvil.fs.read( ".anvil/cdnjs.json", function( content, err ) {
this._error( err, done );
anvil.raise( "all.stop", 0 );
done();
anvil.raise( "all.stop", 0 );
}.bind( this ));
}.bind( this ));
},
_error: function( err, done ) {
if( err ) {
anvil.log.error( err );
done();
}
}

@@ -121,0 +145,0 @@ });

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc