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

leekfund-cli

v1.0.0

Published

期货行情CLI工具 - 获取实时期货行情数据

Downloads

31

Readme

leekfund-cli

股票 & 期货实时行情 CLI 工具,数据源来自新浪财经。

支持 A股美股股票指数期货商品期货海外期货,终端内彩色表格展示涨跌。

安装

# 全局安装
npm install -g leekfund-cli

# 或克隆后本地安装
git clone https://github.com/zxj5470/leekfund-cli.git
cd leekfund-cli
npm install
npm install -g .

依赖:axios commander iconv-lite,全局安装约 30 个包。

快速开始

# 默认行情(沪深300、上证50、中证500、布伦特原油、富时A50)
leekfund

# A股
leekfund sh600519 sh000001

# 美股
leekfund usr_aapl usr_nvda usr_ixic

# 期货
leekfund nf_IF0 hf_OIL

# JSON 输出
leekfund --format json

# 期货基于昨结算计算涨跌幅【注意,国内商品期货字段缺失不支持,仅支持部分海外期货】
leekfund nf_IF0 -b settle

# 混合查询
leekfund sh600519 nf_IF0 usr_aapl

参数

leekfund [codes...] [options]

| 参数 | 默认值 | 说明 | |------|--------|------| | [codes...] | 5个默认期货代码 | 代码列表,支持 A股/美股/期货 | | -f, --format <type> | table | 输出格式:tablejson | | -b, --basis <type> | close | 期货涨跌幅基准:close(昨收盘)或 settle(昨结算)。股票忽略此参数 |

代码速查

A股

sh / sz / bj 开头 + 6位代码,也支持指数:

| 代码 | 名称 | |------|------| | sh600519 | 贵州茅台 | | sh000001 | 上证指数 | | sz000001 | 平安银行 | | bj430047 | 诺思兰德 |

美股

usr_ 开头 + 股票代码:

| 代码 | 名称 | |------|------| | usr_aapl | 苹果 | | usr_nvda | 英伟达 | | usr_tsla | 特斯拉 | | usr_ixic | 纳斯达克指数 | | usr_dji | 道琼斯指数 |

股票指数期货(CFFEX)

| 代码 | 名称 | |------|------| | nf_IF0 | 沪深300指数期货连续 | | nf_IH0 | 上证50指数期货连续 | | nf_IC0 | 中证500指数期货连续 | | nf_IM0 | 中证1000指数期货连续 | | nf_TF0 | 5年期国债期货连续 | | nf_T0 | 10年期国债期货连续 | | nf_TL0 | 30年期国债期货连续 |

海外期货

| 代码 | 名称 | |------|------| | hf_OIL | 布伦特原油 | | hf_CL | WTI纽约原油 | | hf_CHA50CFD | 富时中国A50 | | hf_XAU | 伦敦金(现货黄金) | | hf_SI | 纽约白银 |

商品期货

使用品种拼音首字母 + 0(连续合约):

| 代码 | 名称 | |------|------| | RB0 | 螺纹钢连续 | | M0 | 豆粕连续 | | AG0 | 白银连续 | | CU0 | 沪铜连续 | | AU0 | 沪金连续 |

示例

# A股 & 美股
leekfund sh600519 usr_aapl usr_nvda

# 混合查询
leekfund sh000001 usr_ixic nf_IF0 hf_OIL

# 期货涨跌幅基于昨结算
leekfund nf_IF0 nf_IC0 -b settle

# JSON 输出
leekfund sh600519 -f json

输出示例

股票

────────────────────────────────────────────────────────────────
  实时行情  ──  2026/5/18 19:30:33
────────────────────────────────────────────────────────────────

  贵州茅台  (sh600519)  A股
  最新价     1323.0
  涨跌额     -9.9
  涨跌幅     -0.8%
  今开/昨收  1336.0 / 1333.0
  最高/最低  1342.7 / 1319.6
  成交量     4,966,097 手
  成交额     65.95 亿
  更新时间   2026-05-18 15:00:01

  苹果  (usr_aapl)  美股
  最新价     300.2
  涨跌额     +2.0
  涨跌幅     +0.7%
  今开/昨收  297.9 / 298.2
  最高/最低  303.2 / 296.5
  成交量     54,862,836
  更新时间   2026-05-18 19:30:30
────────────────────────────────────────────────────────────────

期货

────────────────────────────────────────────────────────────────
  实时行情  ──  2026/5/18 19:00:43
  涨跌幅基准: 昨收盘
────────────────────────────────────────────────────────────────

  沪深300指数期货连续  (nf_IF0)  股指期货
  最新价     4802.0
  涨跌额     -22.0
  涨跌幅     -0.5%
  今开/昨收  4810.0 / 4824.0
  最高/最低  4834.6 / 4765.6
  成交量     68,281
  持仓量     149,184
  更新时间   2026-05-18 15:00:00
────────────────────────────────────────────────────────────────

--basis 参数说明

仅对期货生效,股票忽略此参数。

期货有「昨收盘」和「昨结算」两个参考价,一般交易软件默认按昨结算显示涨跌幅:

  • -b close(默认):基准用昨收盘价
  • -b settle:基准用昨结算价
$ leekfund nf_IF0 -b close
  涨跌额     -22.0
  涨跌幅     -0.5%

$ leekfund nf_IF0 -b settle
  涨跌额     -10.6
  涨跌幅     -0.2%

数据源

新浪财经 hq.sinajs.cn,GB18030 编码。非交易时段返回上一交易日数据。

License

BSD-3-Clause