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

iso-countries-spanish

v1.0.3

Published

The name, iso2 code, iso3 code and phone code of the countries by their spanish names

Downloads

21

Readme

iso-countries-spanish

The name, iso2 code, iso3 code and phone code of the countries by their spanish names

Available fields

  • nombre
  • name
  • nom
  • iso2
  • iso3
  • phone_code

Example

import { getSpanishNames, getCountries, getCountryAttributeByField, getPhoneCodeBySpanishName, iso3ToIso2, iso2ToIso3, getIso3CodeBySpanishName, getIso2CodeBySpanishName, getPhoneCodes, getIso3Codes, getIso2Codes, getCountryBy, getCountriesAttribute } from  'iso-countries-spanish';

  

// This log all countries
console.log(getCountries());//[{ nombre: 'Afganistán', name: 'Afghanistan', nom: 'Afghanistan', iso2: 'AF', iso3: 'AFG', phone_code: '93'},{ nombre: 'Albania', name: 'Albania', nom: 'Albanie', iso2: 'AL', iso3: 'ALB', phone_code: '355'},...]

// This log the Spanish name for the country with ISO2 code 'ES'
console.log(getCountryAttributeByField('nombre', 'iso2', 'ES'));//'España'

// This log the Spanish names of all the countries
console.log(getCountriesAttribute('nombre'))//['Afganistán','Albania','Alemania',...]

// This log the object with spanish name 'España'
console.log(getCountryBy('nombre', 'España'));//{ nombre: 'España', name: 'Spain', nom: 'Espagne', iso2: 'ES', iso3: 'ESP', phone_code: '34'}

// This log the ISO2 codes of all the countries
console.log(getIso2Codes());//['AF', 'AL', 'DE', 'DZ', 'AD', 'AO', 'AI', 'AQ', 'AG', 'AN', 'SA', 'AR',...]

// This log the ISO3 codes of all the countries
console.log(getIso3Codes());//['AFG', 'ALB', 'DEU', 'DZA', 'AND', 'AGO', 'AIA', 'ATA', 'ATG', 'ANT', 'SAU', 'ARG',...]

// This log the phone codes of all the countries
console.log(getPhoneCodes());//['93', '355', '49', '213', '376', '244', '1 264', '672', '1 268', '599', '966', '54', '374', '297',

// This log the spanish names of all the countries
console.log(getSpanishNames());// ['Afganistán','Albania','Alemania','Algeria','Andorra','Angola','Anguila','Antártida',...]

// This log the ISO2 code 'ES' for the Spanish name 'España'
console.log(getIso2CodeBySpanishName('España'));//ES

// This log the ISO3 code 'ESP' for the Spanish name 'España'
console.log(getIso3CodeBySpanishName('España'));//ESP

// This log the phone code '34' for the Spanish name 'España'
console.log(getPhoneCodeBySpanishName('España'));//34

// This log the ISO2 code 'ES' for the ISO3 code 'ESP'
console.log(iso3ToIso2('ESP'));//ES

// This log the ISO3 code 'ESP' for the ISO2 code 'ES'
console.log(iso2ToIso3('ES'));//ESP

Contribute

https://github.com/JanselLopez/iso-countries-spanish.git