
Security News
Potemkin Understanding in LLMs: New Study Reveals Flaws in AI Benchmarks
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
simple-load-script
Advanced tools
Very simple promise based script loader and JSONP
npm install --save simple-load-script
var loadScript = require('simple-load-script');
loadScript('//code.jquery.com/jquery-2.2.3.js')
.then(function(scriptRef) {
console.log('success', scriptRef);
})
.catch(function(err) {
console.log(err);
});
var loadScript = require('simple-load-script');
loadScript('//code.jquery.com/jquery-2.2.3.js', {
inBody: true
})
.then(function(scriptRef) {
console.log('success', scriptRef); // 'success', script ref.
})
.catch(function(err) {
console.log(err);
});
var loadScript = require('simple-load-script');
loadScript({
url: '//code.jquery.com/jquery-2.2.3.js',
attrs: { id: 'one', charset: 'UTF-8' }
})
.then(function(scriptRef) {
console.log('success', scriptRef); // 'success', script ref.
})
.catch(function(err) {
console.log(err);
});
Google Maps API
var loadScript = require('simple-load-script');
loadScript({
url: '//maps.googleapis.com/maps/api/js?&callback=gmapiready',
callBackName: 'gmapiready'
})
.then(function(scriptRef) {
console.log('success', scriptRef); // 'success', undefined
})
.catch(function(err) {
console.log(err);
});
JSONP
var loadScript = require('simple-load-script');
loadScripts('//api.ipinfodb.com/v3/ip-city/?format=json&callback=elo', {
callBackName: 'elo',
removeScript: true
})
.then(function(scriptRef) {
console.log('success', scriptRef); // 'success', res
})
.catch(function(err) {
console.log(err);
});
Load more scripts (Promise.all) - urls
var loadScripts = require('simple-load-script').all;
loadScripts(
'//example.com/test1.js',
'//example.com/test2.js',
'//example.com/test3.js'
)
.then(function(scriptRef) {
console.log('success', scriptRef); // 'success', res
})
.catch(function(err) {
console.log(err);
});
Load more scripts (Promise.all) - objects and urls (no url-object pairs allowed), callback must be unique names
var loadScripts = require('simple-load-script').all;
loadScripts(
{
url: '//maps.googleapis.com/maps/api/js?&callback=gmapiready',
callBackName: 'gmapiready'
},
{
url: '//api.ipinfodb.com/v3/ip-city/?format=json&callback=elo',
callBackName: 'elo',
removeScript: true
},
{
url: 'https://api.twitter.com/1/statuses/oembed.json?id=507185938620219395&callback=elo2',
callBackName: 'elo2'
},
'//code.jquery.com/jquery-2.2.3.js'
)
.then(function(scriptRef) {
console.log('success', scriptRef); // 'success', array
})
.catch(function(err) {
console.log(err);
});
url
(optional) - file to append to bodyoptions
(required) - options in objecturl
(string) - file to append to bodyinBody
(boolean) - append to document.body
instead of document.head
attrs
(object) - with attributes to append to script tag (charset
, type
, id
, …)callBackName
(string) - callback to add to window
object; promise is resolved after callback is fired; callback is removed after that; multiple callbacks must have unique namesdontRemoveCallBack
(boolean) - from window
after load; no real use - let me knowremoveScript
(boolean) - after load (for JSONP, other reasons); it's always removed on errorvar loadScript = require('simple-load-script');
loadScript(/**/);
define(['simple-load-script'], function(loadScript) {
loadScript(/**/);
});
simpleLoadScript(/**/);
import loadScript from 'simple-load-script';
loadScript(/**/);
Good example
npm install es6-promise --save
1.0.0
dontRemoveCallBack
and removeScript
FAQs
Very simple promise based script and JSONP
The npm package simple-load-script receives a total of 5,596 weekly downloads. As such, simple-load-script popularity was classified as popular.
We found that simple-load-script demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.