peruuse
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

PeruUse

Getting Started

Installation

npm install peruuse --save

Use in Browser

<script src="https://unpkg.com/peruuse@1.2.0/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/peruuse@1.2.0/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

Readme

Keywords

Package Sidebar

Install

npm i peruuse

Weekly Downloads

4

Version

1.2.0

License

MIT

Unpacked Size

523 kB

Total Files

11

Last publish

Collaborators

  • diaz268