
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
koa-safe-jsonp
Advanced tools
Safe jsonp plusins for koa.
$ npm install koa-safe-jsonp
var jsonp = require('koa-safe-jsonp');
var koa = require('koa');
var app = koa();
jsonp(app, {
callback: '_callback', // default is 'callback'
limit: 50, // max callback name string length, default is 512
});
app.use(function* () {
this.jsonp = {foo: "bar"};
});
app.listen(1984);
curl test it:
$ curl 'http://127.0.0.1:1984/foo.json?_callback=fn' -v
* About to connect() to 127.0.0.1 port 1984 (#0)
* Trying 127.0.0.1...
* Adding handle: conn: 0x7fca3c004000
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fca3c004000) send_pipe: 1, recv_pipe: 0
* Connected to 127.0.0.1 (127.0.0.1) port 1984 (#0)
> GET /foo.json?_callback=fn HTTP/1.1
> User-Agent: curl/7.30.0
> Host: 127.0.0.1:1984
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: koa
< X-Content-Type-Options: nosniff
< Content-Type: application/javascript
< Content-Length: 51
< Date: Thu, 17 Jul 2014 15:29:05 GMT
< Connection: keep-alive
<
* Connection #0 to host 127.0.0.1 left intact
/**/ typeof fn === 'function' && fn({"foo":"bar"});
FAQs
Safe jsonp plugins for koa.
The npm package koa-safe-jsonp receives a total of 79 weekly downloads. As such, koa-safe-jsonp popularity was classified as not popular.
We found that koa-safe-jsonp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.