1.1.2 • Published 1 month ago

rest-countries v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

REST Countries

This library is a wrapper for the REST Countries API (v3.1) to access information about 250 countries around the world easily and is written in TypeScript to ensure type safety and provide a better developer experience.

Links

Installation

npm i rest-countries

yarn add rest-countries

pnpm add rest-countries

bun add rest-countries

Example

import { getAll, searchByName } from 'rest-countries';

// Fetch all the countries
const countries = await getAll();

// Fetch all the countries with filtered fields (this will make the request faster)
const countries = await getAll(['name', 'capital', 'population']);

// Search amoung countries by their name
const countries = await searchByName('Vietnam');
1.1.1

1 month ago

1.0.1

2 months ago

1.1.2

1 month ago

1.0.0

2 months ago

1.0.0-dev

2 months ago