npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@chenddcoder/ddpost

v1.1.3

Published

控制台里的 Postman — 交互式 HTTP 客户端

Downloads

1,016

Readme

ddpost — 控制台里的 Postman

交互式 HTTP 客户端,支持目录管理、环境变量、.http 文件格式、curl 解析、动态变量。

安装

npm install -g @chenddcoder/ddpost

快速开始

ddpost
╔ Console Postman ═══════════════════════════════╗
║  Env: default     0 dirs, 0 requests           ║
╚═══════════════════════════════════════════════╝

📂 Directories:
  (no directories — use /mkdir)

[default] >

核心概念

两种变量

| 写法 | 用途 | 说明 | |---|---|---| | {{DOMAIN}} | 环境变量 | 通过 /env-set 设置,跨请求共享 | | ${file} | 动态变量 | 执行时临时传入,每次可以不同 |

存储结构

数据保存在 ~/.ddpost/<项目名>/

~/.ddpost/
└── <项目名>/
    ├── Users/                      ← /mkdir 创建的目录 = 真实文件夹
    │   ├── GetUsers.http           ← 标准 .http 文件
    │   └── CreateUser.http
    ├── environments.json           ← 环境变量
    ├── meta.json                   ← 当前环境、上次目录
    └── history_cmds.txt            ← 命令历史(↑ 键回溯)

.http 文件是标准格式,可用任何编辑器直接修改。

命令参考

目录管理

| 命令 | 作用 | |---|---| | /mkdir <name> | 创建目录 | | /rmdir <name> | 删除目录(递归) | | cd <name>cd <n> | 进入目录(Tab 补全) | | cd ..cd / | 返回根目录 | | /list | 刷新显示 |

请求管理

| 命令 | 作用 | |---|---| | /new <name> <method> <url> | 当前目录下创建请求(行内) | | /new <dir> <name> <method> <url> | 指定目录创建请求 | | /new | 交互式创建 | | /rm <n>/rm <dir>/<name> | 删除请求 | | /rename <dir>/<旧名> <新名> | 重命名 | | /edit <n> | 编辑请求(URL / Headers / Body) | | /save <dir> <name> | 保存上一次执行的结果为请求 |

执行请求

| 命令 | 作用 | |---|---| | GET http://... | 直接执行原始 HTTP 请求 | | POST http://... | 任意 HTTP method 均可 | | curl -X POST http://... -d "data" | 粘贴 curl 命令 | | !0 | 运行当前目录第 0 个请求 | | !0 file=my.pdf | 运行并传入 ${file} 的值 | | !0 file="path with spaces" | 带空格的 value 用引号包裹 | | !! | 重复上一次请求 | | ! | 查看上一次请求摘要 |

环境变量

| 命令 | 作用 | |---|---| | /env | 查看当前环境 | | /env <name> | 切换到指定环境 | | /envs | 列出所有环境 | | /env-new <name> | 新建环境(克隆当前) | | /env-set <key>=<value> | 设置变量 | | /env-del <key> | 删除变量 |

导入 / 工具

| 命令 | 作用 | |---|---| | /import | 多行粘贴模式(粘贴 .http 内容) | | /history | 查看请求历史 | | /clear | 清屏 | | /quit | 退出 |

使用示例

# 创建目录和请求
/mkdir Users
cd Users
/new GetUsers GET http://{{DOMAIN}}/api/users

# 创建第二个请求
/new CreateUser POST http://{{DOMAIN}}/api/users
# 然后输入 Headers 和 Body(交互式)

# 运行
!0                                                    # GET /api/users
!0 DOMAIN=localhost:9000                               # 临时覆盖环境变量

# 动态变量
# 请求 URL: http://{{DOMAIN}}/file?name=${file}&type=pdf
!0 file=报告V3.pdf                                     # 执行时传值
!0 file="年度总结 2024.pdf"                             # 带空格用引号

# 直接执行
GET http://localhost:8080/health

# 环境切换
/env-new staging
/env-set DOMAIN=staging.example.com
!0                                                    # 走 staging 环境

环境变量 vs 动态变量

请求 URL: http://{{DOMAIN}}/api/{{version}}/file?name=${file}

{{DOMAIN}}  → 从当前环境取值  →  /env-set DOMAIN=localhost:8080
{{version}} → 从当前环境取值  →  /env-set version=v2
${file}     → 执行时临时传入  →  !0 file=test.pdf

开发

npm run typecheck   # TypeScript 类型检查
npm start           # 启动