Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

jsonp

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonp - npm Package Compare versions

Comparing version
0.0.4
to
0.1.0
+1
-1
component.json

@@ -5,3 +5,3 @@ {

"description": "A sane JSONP implementation.",
"version": "0.0.4",
"version": "0.1.0",
"dependencies": {

@@ -8,0 +8,0 @@ "visionmedia/debug": "*"

0.1.0 / 2014-12-30
==================
* Make sure `script.parentNode` exists before removing the script element (#12, @azer)
* Return function to cancel in-progress jsonp request (#11, @feross)
* add documentation for `prefix` option (#10, @feross)
0.0.4 / 2014-03-11

@@ -3,0 +10,0 @@ ==================

@@ -63,9 +63,15 @@ /**

function cleanup(){
script.parentNode.removeChild(script);
if (script.parentNode) script.parentNode.removeChild(script);
window[id] = noop;
if (timer) clearTimeout(timer);
}
function cancel(){
if (window[id]) {
cleanup();
}
}
window[id] = function(data){
debug('jsonp got', data);
if (timer) clearTimeout(timer);
cleanup();

@@ -85,2 +91,4 @@ if (fn) fn(null, data);

target.parentNode.insertBefore(script, target);
return cancel;
}
{
"name": "jsonp",
"description": "A sane JSONP implementation.",
"version": "0.0.4",
"version": "0.1.0",
"dependencies": {

@@ -6,0 +6,0 @@ "debug": "*"

@@ -30,5 +30,7 @@

disable (defaults to `60000`)
- `prefix` (`String`) prefix for the global callback functions that
handle jsonp responses (defaults to `__jp`)
- `fn` callback
The callback is called with `err, data` parameters.
The callback is called with `err, data` parameters.

@@ -38,4 +40,7 @@ If it times out, the `err` will be an `Error` object whose `message` is

Returns a function that, when called, will cancel the in-progress jsonp request
(`fn` won't be called).
## License
MIT