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

china-railway-station

v2.0.3

Published

中国铁路车站信息

Readme

China Railway Station

npm version npm version MIT Licence

中国铁路车站信息

支持环境

  • Node.js >= 21
  • Chrome >= 117

在更低版本中使用需要自行根据框架处理降级或polyfill

使用

Script

<script src="build/index.iife.js"></script>
<script>
    const station = new ChinaRailwayStation();

    station.list; // 全部车站列表
    station.find("北京西"); // 获取 北京西 相关车站
</script>

ES Module

安装依赖:

npm i china-railway-station

引用依赖:

import ChinaRailwayStation from "china-railway-station";

const station = new ChinaRailwayStation();

station.list; // 全部车站列表
station.find("北京西"); // 获取 北京西 相关车站

CommonJS

安装依赖:

npm i china-railway-station

引用依赖:

const ChinaRailwayStation = require("china-railway-station");

const station = new ChinaRailwayStation();

station.list; // 全部车站列表
station.find("北京西"); // 获取 北京西 相关车站

属性、方法

list

获取车站全部列表

  • 类型:Station[]

group

获取车站全部列表(城市分组格式)

  • 类型:Record<string, Station[]>

find

模糊搜索车站

  • 类型:function
  • 参数:

| 参数名 | 类型 | 是否可选 | 默认值 | 说明 | |:---:|:---:|:---:|:---:|---| | keyword | string | 否 | - | 搜索关键词 |

  • 返回值:Station[]

findByName

通过车站名获取车站信息

  • 类型:function
  • 参数:

| 参数名 | 类型 | 是否可选 | 默认值 | 说明 | |:---:|:---:|:---:|:---:|---| | name | string | 否 | - | 车站名 |

  • 返回值:Station | undefined

findByTelecode

通过电报码获取车站信息

  • 类型:function
  • 参数:

| 参数名 | 类型 | 是否可选 | 默认值 | 说明 | |:---:|:---:|:---:|:---:|---| | telecode | string | 否 | - | 电报码 |

  • 返回值:Station | undefined

findByPinyinCode

通过拼音码获取车站信息

  • 类型:function
  • 参数:

| 参数名 | 类型 | 是否可选 | 默认值 | 说明 | |:---:|:---:|:---:|:---:|---| | pinyinCode | string | 否 | - | 拼音码 |

  • 返回值:Station[]

findByCity

通过城市名或城市编码获取车站信息

  • 类型:function
  • 参数:

| 参数名 | 类型 | 是否可选 | 默认值 | 说明 | |:---:|:---:|:---:|:---:|---| | city | string | 否 | - | 城市名/城市编码 |

  • 返回值:Station[]