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

simple-load-script

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

simple-load-script - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

6

changelog.md
# changelog
## x.x.x
## 1.0.2
* added `insertInto` config option
## 1.0.1
* rename index.js
* readme

@@ -6,0 +10,0 @@ * changes in `all` method

4

package.json
{
"name": "simple-load-script",
"version": "1.0.1",
"version": "1.0.2",
"description": "Very simple promise based script and JSONP",

@@ -15,5 +15,5 @@ "repository": "tomek-f/simple-load-script",

"main": "simpleLoadScript.js",
"author": "Tomek Fijoł",
"author": "Tomek Fijoł <tomekfijol@gmail.com> (http://tomekf.pl/)",
"license": "MIT",
"readmeFilename": "README.md"
}

@@ -152,2 +152,3 @@ # simple-load-script

* `removeScript` (boolean) - after load (for JSONP, other reasons); it's always removed on error
* `insertInto` (string) - [CSS selector (an ID, class name, element name, etc.)](https://developer.mozilla.org/en/docs/Web/API/Document/querySelector) to insert the script into. Overrides `inBody` value.

@@ -154,0 +155,0 @@ ## Returned values

@@ -10,3 +10,2 @@ (function (root, factory) {

}(this, function () {
var undef;

@@ -34,3 +33,12 @@

var script = document.createElement('script');
var where = options.inBody ? document.body : document.head;
var where = (function () {
if (options.insertInto) {
return document.querySelector(options.insertInto);
}
return options.inBody ? document.body : document.head;
}());
if (!where) {
reject('Error: no DOM element to append script');
return;
}
var attrs = options.attrs;

@@ -78,3 +86,2 @@ var removeScript = options.removeScript;

return getScript;
}));

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