peruuse
v1.2.0
Published
Library Peru utils
Downloads
10
Readme
PeruUse
Getting Started
Installation
npm install peruuse --save
Use in Browser
<script src="https://unpkg.com/[email protected]/dist/browser/index.min.js"></script>
<script>
console.log(ubigeo.getDepartments());
console.log(ubigeo.getProvince('01'));
console.log(ubigeo.getDistrict('0101'));
</script>
Use in ESM-compatible
import { ubigeo } from 'https://unpkg.com/[email protected]/dist/index.mjs';
import { ubigeo } from 'peruuse';
Use in CommonJS
const ubigeo = require('peruuse').ubigeo;
const { ubigeo } = require('peruuse');
API
/**----------------------
* Array of departments
*@return [{ code: '01', name: 'Amazonas' } ...]
*------------------------**/
ubigeo.getDepartments();
/**----------------------
* Array of provinces by code.department
*@param code string
*@return [{ code: '0101', name: 'Chachapoyas' } ...]
*------------------------**/
ubigeo.getProvince(code);
/**----------------------
* Array of districts by code.province
*@param code string
*@return [{ code: '010101', name: 'Chachapoyas' } ...]
*------------------------**/
ubigeo.getDistrict(code);
ROADMAP
- [ ] List departments and include provinces
- [ ] List provinces and include their districts