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

spanish-cities-info

v1.0.6

Published

Information about cities in Spain

Downloads

38

Readme

spanish-cities-info

Esta librería proporciona una lista de ciudades de España, con varias funciones.

Type city

{
   city: 'Almería',
   cityCode: '04013',
   province: 'Almería',
   community: 'Andalucia',
   latitude: '36.8381',
   longitude: '-2.4597',
   language: [ 'cast' ]
 },

Funcionalidades

  • Obtener todas las ciudades de España: Puedes obtener una lista completa de todas las ciudades disponibles en España.
  • Obtener una ciudad por zipCode: Proporciona la capacidad de buscar una ciudad por su código postal.
  • Obtener una ciudad por nombre: Permite buscar una ciudad por su nombre.
  • Obtener ciudades dentro de un rango: Te permite encontrar todas las ciudades dentro de un rango específico de una ciudad determinada.

Instalación

Puedes instalar esta librearía utilizando npm:

npm install locationsInfo

Uso

// Importar el módulo
import { getAllCities, getCitiesInRange } from 'spanish-cities-info';

// Ejemplo de uso para obtener todas las ciudades
const allcities = getAllCities();

// Ejemplo de uso para obtener una ciudad por nombre
  const citiesInRange = getCitiesInRange('Ferrol', 10);
 [
  {
      city: 'Ferrol',
      cityCode: '15036',
      province: 'A Coruña',
      community: 'Galicia',
      latitude: '43.4832',
      longitude: '-8.2369',
      language: [ 'cast', 'ga' ]
    },
    {
      city: 'Fene',
      cityCode: '15035',
      province: 'A Coruña',
      community: 'Galicia',
      latitude: '43.45',
      longitude: '-8.15',
      language: [ 'cast', 'ga' ]
    },
    {
      city: 'Neda',
      cityCode: '15055',
      province: 'A Coruña',
      community: 'Galicia',
      latitude: '43.4996',
      longitude: '-8.1594',
      language: [ 'cast', 'ga' ]
    },
    {
      city: 'Narón',
      cityCode: '15054',
      province: 'A Coruña',
      community: 'Galicia',
      latitude: '43.5333',
      longitude: '-8.2167',
      language: [ 'cast', 'ga' ]
    },
    {
      city: 'Pontedeume',
      cityCode: '15069',
      province: 'A Coruña',
      community: 'Galicia',
      latitude: '43.4078',
      longitude: '-8.1721',
      language: [ 'cast', 'ga' ]
    },
    {
      city: 'Mugardos',
      cityCode: '15051',
      province: 'A Coruña',
      community: 'Galicia',
      latitude: '43.4604',
      longitude: '-8.2551',
      language: [ 'cast', 'ga' ]
    },
    {
      city: 'Ares',
      cityCode: '15004',
      province: 'A Coruña',
      community: 'Galicia',
      latitude: '43.4244',
      longitude: '-8.2043',
      language: [ 'cast', 'ga' ]
    }
  ]

## Contribución

Si encuentras algún error, tienes alguna sugerencia de mejora, 
o si falta tu ciudad en la lista, 
¡me encantaría recibir tu contribución! 
Puedes [crear un issue](https://github.com/ManuelCebreiro/locationsInfo/issues)
para reportar el problema o 
[enviar un pull request](https://github.com/ManuelCebreiro/locationsInfo/pulls) 
con tus cambios.

Para añadir una nueva ciudad:
1. Asegúrate de tener el código postal, nombre de la ciudad, provincia,
   comunidad autónoma y sus códigos correspondientes.
2. Edita el archivo JSON de ciudades y agrega la información de la nueva ciudad.
3. Envia tu pull request con la nueva información y me encargaré de revisarlo.

¡Esperamos tu contribución!