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

require-from-url

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-from-url - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

8

index.js
var parse = require("url").parse;
var listen = require("./addLoadListener.js");
var Promise= require("promise-tiny");
var Steps = require("promise-tiny/Steps");

@@ -9,3 +9,3 @@ module.exports = function() {

values = Array(_len);
return new Promise(function(resolve, reject) {
return new Steps().on('Begin', function(next) {
_url.forEach(function(url, index) {

@@ -17,7 +17,7 @@ listen(parse(url), function(value) {

if(values[i] instanceof Error) {
reject(values[i]);
next('Rejected', values[i]);
return;
}
}
resolve(values);
next('Resolved', values);
}

@@ -24,0 +24,0 @@ });

{
"name": "require-from-url",
"version": "1.0.2",
"version": "2.0.0",
"description": "Require module from URL",

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

@@ -17,12 +17,12 @@ # require-from-url

requireFromUrl(["http://yishizhencang.com:8080/HelloWorld.js"])
.then(function(HelloWorld) {
var api = new HelloWorld.default;
api.welcome(function(greeting) {
console.log(greeting);
requireFromUrl("http://yishizhencang.com:8080/HelloWorld.js")
.on('Resolved', function(next, HelloWorld) {
var api = new HelloWorld.default;
api.welcome(function(greeting) {
console.log(greeting);
});
})
.on('Rejected', function(next, e) {
console.log(e);
});
})
.catch(function(e) {
console.log(e);
});
```

@@ -29,0 +29,0 @@

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