Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

country-code-lookup

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

country-code-lookup - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

LICENSE

4

index.js

@@ -25,2 +25,6 @@ module.exports.byFips = function(code) {

module.exports.byCountry = function(country) {
return search('country', country)
}
function search(field, code) {

@@ -27,0 +31,0 @@ for (var i = 0; i < countries.length; i++) {

2

package.json
{
"name": "country-code-lookup",
"version": "0.0.13",
"version": "0.0.14",
"description": "Finds countries by various country codes",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -37,2 +37,5 @@ [![Build Status](https://travis-ci.org/richorama/country-code-lookup.svg?branch=master)](https://travis-ci.org/richorama/country-code-lookup)

// search by country name
lookup.byCountry('United Kingdom');
// get an array of all countries

@@ -39,0 +42,0 @@ lookup.countries

@@ -43,2 +43,12 @@ var countries = require('./index.js')

it('finds countries by country name', function(done) {
var uk = countries.byCountry('United Kingdom')
if (!uk) return done('no country')
if (uk.country !== 'United Kingdom') return done('wrong country')
if (uk.continent !== 'Europe') return done('wrong continent')
if (uk.region !== 'Western Europe') return done('wrong region')
if (uk.capital !== 'London') return done('wrong capital')
return done()
})
it('finds countries by iso number as a string', function(done) {

@@ -45,0 +55,0 @@ var uk = countries.byIso('826')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc