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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@chuxingpay/location

v1.3.6

Published

location mapping for chuxingpay.com

Downloads

24

Readme

付迅行政区域 SDK

✅ http://preview.www.mca.gov.cn/article/sj/xzqh/2020/2020/202101041104.html 除港澳台(直辖市城区)外,所有省市县ID与此文档保持一致

安装

npm i @chuxingpay/location

// import multiple methods, json could be big, proceed with caution
const { getById, getCityById } = require("@chuxingpay/location")

// import single methods, will only load minimal necessary json, recommanded 👍
const { getById } = require("@chuxingpay/location/es/getById")

接口函数

| Methods | @params | @return | Description | Recommand | | -------------------------- | --------- | ------- | ------------------------------------------------ | --------- | | getProvinceList | name='' | Array | 返回省列表 | 👍 | | getCityList | name='' | Array | 返回市列表 | 👍 | | getHotCities | | Array | 返回热门城市列表(已排序) | 👍 | | getByCityId | id='' | Array | 根据 citytId 查询 | 👍 | | getByProvinceId | id='' | Array | 根据 provinceId 查询 | 👍 | | getById | id='' | Object | 根据 id 查询省市区 | 👍 | | getCitiesByFirstLetter | letter='' | Array | 根据首字母查询城市列表 | 👍 | | getTree | depth=3 | Array | 根据 depth 查询(默认 3) (key 与其他方法有差异) | ✅ | | getByName | name='' | Array | 根据省/市/区/pinyin 查询 | ✅ | | getCityById | id='' | Object | 根据 id 查询城市 | ✅ | | getByDistrictId | id = '' | Array | 根据 districtId 查询 | ✅ | | getDistrictList | name='' | Array | 返回区列表 | ✅ | | getDistrictsByCityId | name='' | Array | 根据城市 ID 返回区列表 | ✅ | | getList | conds={} | Array | 组合条件查询 | 👎 |

✅ second param regionCode of each methods are default set to '100000' for future development

property changelog

[
    { // province obj
        "pid": "100000",
        "pname": "中国",
        "id": "810000",
        "name": "香港特别行政区",
        "brief": "香港",
        "lat": 22.320048,
        "lng": 114.173355,
        "level": 1,
        "pinyin": "Xianggang",
        "provinceId": "810000", 👎
        "provinceName": "香港特别行政区", 👎
        "latitude": 22.320048, 👎
        "longtitude": 114.173355, 👎
        "levelType": 1 👎
    },
    { // city obj
        "pid": "710000",
        "pname": "台湾省",
        "pnameEn": "Taiwan",
        "id": "719013",
        "name": "花莲县",
        "brief": "花莲",
        "lat": 23.973909,
        "lng": 121.608198,
        "level": 2,
        "pinyin": "Hualian",
        "provinceName": "台湾省", 👎
        "provinceId": "710000", 👎
        "cityName": "花莲县", 👎
        "cityId": "719013", 👎
        "latitude": 23.973909, 👎
        "longtitude": 121.608198, 👎
        "levelType": 2, 👎
        "shortName": "花莲", 👎
        "shortNameEn": "Hualian", 👎
    },
    { // district obj
        "pid": "120000",
        "pname": "天津市",
        "cid": "120100",
        "cname": "天津城区",
        "id": "120101",
        "name": "和平区",
        "lat": 39.118327,
        "lng": 117.195907,
        "level": 3,
        "pinyin": "Hepingqu",
        "provinceName": "天津市", 👎
        "provinceId": "120000", 👎
        "cityName": "天津城区", 👎
        "cityId": "120100", 👎
        "districtName": "和平区",
        "districtId": "120101",
        "latitude": 39.118327, 👎
        "longtitude": 117.195907, 👎
        "levelType": 3, 👎
    }
]

✅ key with 👎 are deprecated and will be removed in next major release