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

loadsync

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loadsync - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

debug.js

46

index.js

@@ -1,1 +0,45 @@

console.log('Comming soon');
'use strict';
var debug = require('./debug.js')('geotool:loadsync');
var loadsync = function loadsync(params) {
debug && debug(' + constructor begin ...');
params = params || {};
params.states = params.states || [];
this.define = function(opts) {
opts = opts || {};
params.states = opts.states || params.states;
debug && debug('define states: %s', JSON.stringify(params.states));
return this;
}
var callbacks = [];
this.ready = function(callback) {
debug && debug('append a new callback');
if (typeof(callback) === 'function') {
callbacks.push(callback);
}
return this.check();
}
this.check = function(state) {
debug && debug('check state: %s', state);
var stateInd = params.states.indexOf(state);
if (stateInd >= 0) {
params.states.splice(stateInd, 1);
}
if (params.states.length === 0) {
debug && debug('ready, run all of callbacks');
callbacks.forEach(function(callback) {
callback();
});
}
return this;
}
debug && debug(' - constructor end!');
};
module.exports = new loadsync();

2

package.json
{
"name": "loadsync",
"version": "0.1.0",
"version": "0.1.1",
"description": "Load javascript libraries in browser synchronously",

@@ -5,0 +5,0 @@ "main": "index.js",

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