# @bany/curl-to-json 中文文档

规范地址：https://npmcn.com/package/%40bany/curl-to-json/

版本：1\.2\.10
npm 元数据更新时间：2026-01-20T07:28:16.524Z
中文译文更新时间：2026-11-07T16:41:41.350Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40bany/curl-to-json
原文对照：https://npmcn.com/package/%40bany/curl-to-json/?lang=original
项目主页：https://github.com/9bany/curl-to-json#readme
源码仓库：https://github.com/9bany/curl-to-json

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：12.7 kB，8 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- 运行依赖：1 个
- 首次发布：2022-03-13T05:55:17.929Z
- 最新版本发布：2026-01-20T07:28:16.395Z
- 近 30 天下载量：33074（2026-10-08 至 2026-11-06，npm 官方下载统计）
- 已发布版本数：20（近 12 个月 2 个）

## 中文简介

将卷曲格式转换为 json

## 安装

```sh
npm install @bany/curl-to-json
```

也可以使用：`pnpm add @bany/curl-to-json`、`yarn add @bany/curl-to-json`、`bun add @bany/curl-to-json`

## README

# 卷起对接子

[@bany/curl-to-json (英语)](https://www.npmjs.com/package/@bany/curl-to-json) Conver 卷曲为 json 格式 .

## 安装

```
npm i @bany/curl-to-json
```

## 使用量

```js
const parse = require('@bany/curl-to-json');

var out = parse(`your_curl`);

```

## 示例

```js
const parse = require('@bany/curl-to-json');

var out = parse(`curl -X GET 'http://localhost:3001/search?search=react&asdfa=asfdaf' \
--header 'xapi-key: 21432139847290402402190' \
--header 'Content-Type: text/html' \
--data-raw '{
    "name": "string",
    "name2": "string"
}'`);
console.log(out)

/**
 {
  method: 'GET',
  header: {
    'xapi-key': '21432139847290402402190',
    'Content-Type': 'text/html'
  },
  url: 'http://localhost:3001/search',
  origin: 'http://localhost:3001',
  params: { search: 'react', asdfa: 'asfdaf' },
  body: { name: 'string', name2: 'string' }
} */
```

## CURL公约

-   [检查此特征](https://gist.github.com/subfuzion/08c5d85437d5d4f00e58)
-   接受邮差的卷发.

## 捐款

欢迎新一期或专题请求.

如果您想协调检查项目的问题 .

1.  叉子存储器
2.  执行您的解决方案
3.  提交
4.  打开拉请求

谢谢!

## 常见问题

### @bany/curl-to-json 是什么？

将卷曲格式转换为 json

### 如何安装 @bany/curl-to-json？

在项目目录运行 npm install @bany/curl-to-json，或使用 pnpm add / yarn add / bun add。

### @bany/curl-to-json 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @bany/curl-to-json 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### @bany/curl-to-json 可以商用吗？

@bany/curl-to-json 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @bany/curl-to-json 的下载量有多少？

根据 npm 官方下载统计，@bany/curl-to-json 在 2026/10/08 – 2026/11/06 这 30 天内被下载 33,074 次，日均约 1,102 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @bany/curl-to-json 还在维护吗？

最新版本 1\.2\.10 发布于 2026/01/20（9 个月前）；至今共发布 20 个版本，其中过去 12 个月发布了 2 个；首次发布于 2022/03/13。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

