china-citys
v0.0.1
Published
中国省市区,js封装
Downloads
115
Readme
一个提供api操作全国省市区数据的js库
Directory
.
├── demo
├── dist # production code
├── doc # document
├── src # source code
├── test # unit test
├── CHANGELOG.md
└── TODO.md
Usage
npm installation
$ npm install --save china-citys
Node.js
const regions = require("china-citys");
regions.getProvinces("13") // provinceList
regions.getCitysByProvince("13") // provinceList
webpack
import regions from 'china-citys';
regions.getProvinces("13") // provinceList
regions.getCitysByProvince("13") // provinceList
Require.js
requirejs(['node_modules/china-citys/dist/index.aio.js'], function (regions) {
regions.getProvinces("13") // provinceList
regions.getCitysByProvince("13") // provinceList
})
Browser
<script src="node_modules/china-citys/dist/index.aio.js"></script>
<script>
regions.getProvinces("13") // provinceList
regions.getCitysByProvince("13") // provinceList
</script>