
Company News
Socket Partners with Replit to Block Malicious Packages in AI-Powered Development
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.
@zenweb/body
Advanced tools
支持 JSON、Form 等内容格式的基础解析模块
import { Context, mapping, Body, BodyHelper } from 'zenweb';
export class Controller {
@mapping({ path: '/', method: 'POST' })
post(body: Body) {
console.log(body.type); // POST body 内容类型
console.log(body.data); // POST Body 内容解析完成后的数据
}
@mapping({ path: '/', method: 'POST' })
post(body: BodyHelper) {
console.log(body.get({ age: '!int' })); // 类型转换&校验
}
}
| 项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| encoding | string | 'utf-8' | 在未能匹配到 header 信息时,默认text内容编码格式 |
| limit | number | 1MB | 内容大小限制 |
| inflate | boolean | true | 是否支持压缩内容解压 |
| textTypes | string[] | ['text/*', 'json', '+json', 'xml', '+xml', 'urlencoded'] | 支持解析为文本的类型 |
| parses | BodyParserClass[] | [JSONParser, URLEncodedParser] | 对象解析器 |
FAQs
Zenweb Body module
The npm package @zenweb/body receives a total of 48 weekly downloads. As such, @zenweb/body popularity was classified as not popular.
We found that @zenweb/body 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.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.