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

@clregions/core

v0.1.7

Published

¡Bienvenido! Con nuestra librería de TypeScript, podrás acceder fácilmente a información actualizada y precisa sobre las regiones, provincias y comunas de Chile, ahorrando tiempo y esfuerzo al no tener que recopilar y mantener los datos tú mismo.

Downloads

188

Readme

Chile regiones, provincias y comunas

¡Bienvenido! Con nuestra librería de TypeScript, podrás acceder fácilmente a información actualizada y precisa sobre las regiones, provincias y comunas de Chile, ahorrando tiempo y esfuerzo al no tener que recopilar y mantener los datos tú mismo.

🔒 Ofrece una estructura de tipos segura para trabajar con confianza en la integridad de tus datos.

🌎 Te permite trabajar con datos geográficos de una manera intuitiva y fácil de entender.

🚫 La librería clregions no tiene dependencias externas, lo que reduce los conflictos de versiones y simplifica el proceso de instalación.

🚀 Compatible con Node.js a partir de la versión 14, lo que te permite utilizarla en tus proyectos de backend.

🌐 También es compatible con los navegadores web, lo que te permite utilizarla en tus proyectos frontend.

🤖 Se integra perfectamente con TypeScript y es fácil de usar para nuevos usuarios.

🎨 clregions es altamente personalizable y puedes utilizar sólo una parte de la librería si eso es todo lo que necesitas.

📚 La documentación detallada de clregions te ayudará a comprender fácilmente cómo utilizar la librería y resolver cualquier problema.

🛡️ Pull Request bienvenidos!! Siéntete libre de contribuir con la librería, cualquier ayuda es bienvenida.

☕ Si tienes alguna idea de como mejorar nuestra API, abre una discusión y conversemos!

Instalación

Con npm

$ npm install @clregions/core

Con yarn

$ yarn add @clregions/core

Con pnpm

$ pnpm add @clregions/core

Uso

Obtener todas las regiones

import { getAllRegions } from '@clregions/core';

const regions: Record<string, CLRegion> = getAllRegions();

Obtener una región por su código

import { getRegionById } from '@clregions/core';

const region: CLRegion | null = getRegionById('13');

Obtener todas las provincias de una región

import { getAllProvincesByRegion } from '@clregions/core';
const provinces: Record<string, CLProvince> | null = getAllProvincesByRegion('13');

Obtener todas las comunas de una región

import { getAllCommunesByRegion } from '@clregions/core';
const communes: Record<string, CLCommune> | null = getAllCommunesByRegion('13');

Obtener todas las provincias

import { getAllProvinces } from '@clregions/core';

const provinces: Record<string, CLProvince> = getAllProvinces();

Obtener una provincia por su código

import { getProvinceById } from '@clregions/core';

const province: CLProvince | null = getProvinceById('011');

Obtener todas las comunas de una provincia

import { getAllCommunesByProvince } from '@clregions/core';
const communes: Record<string, CLCommune> | null = getAllCommunesByProvince('011');

Obtener todas las comunas

import { getAllCommunes } from '@clregions/core';

const communes: Record<string, CLCommune> = getAllCommunes();

Obtener una comuna por su código

import { getCommuneById } from '@clregions/core';

const commune: CLCommune | null = getCommuneById('01101');