Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
koa-json
Advanced tools
Readme
JSON pretty-printed response middleware. Also converts node object streams to binary.
$ npm install koa-json
pretty
default to pretty response [true]param
optional query-string param for pretty responses [none]spaces
JSON spaces [2]Always pretty by default:
var json = require('koa-json');
var Koa = require('koa');
var app = new Koa();
app.use(json());
app.use((ctx) => {
ctx.body = { foo: 'bar' };
});
yields:
$ GET /
{
"foo": "bar"
}
Default to being disabled (useful in production), but togglable via the query-string parameter:
var Koa = require('koa');
var app = new Koa();
app.use(json({ pretty: false, param: 'pretty' }));
app.use((ctx) => {
ctx.body = { foo: 'bar' };
});
yields:
$ GET /
{"foo":"bar"}
$ GET /?pretty
{
"foo": "bar"
}
MIT
FAQs
pretty (non-compressed) json response middleware
The npm package koa-json receives a total of 75,115 weekly downloads. As such, koa-json popularity was classified as popular.
We found that koa-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.