2.0.6 • Published 4 years ago

national-geographic-api v2.0.6

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

national-geographic-api

NodeJS National Geographic API

version travis build codecov coverage dependency status Known Vulnerabilities Codacy Badge MIT License semantic-release Commitizen friendly stability-stable Greenkeeper code style

Table of Contents

Documentation

You can find documentation here

Installation

npm i national-geographic-api

Setup

Import

const natgeo = require('national-geographic-api').NationalGeographicAPI;

or

import {NationalGeographicAPI} from 'national-geographic-api';

Features

  • Get Latest News articles with title, description, img and other metadata
  • Paginate news digest
  • Promises and callback support on all functions, if no callback provided, promise returned, allows you to manage flow as you desire
  • Typescript code with typings

Latest News

Returns the latest news from National Geographic News API with metadata.

natgeo.getLatestNews(`PAGE_SIZE` , `PAGE_NUMBER` , `CALLBACK` )
    .then((result) => ...);

or

const result = await NationalGeographicAPI.getLatestNews(`PAGE_SIZE` , `PAGE_NUMBER` , `CALLBACK`);
  • PAGE_SIZE - optional, defaults to 3 story items
  • PAGE_NUMBER - optional, defaults to page 0
  • CALLBACK - optional, if no callback provided returns a promise

Photo of the Day

Returns requested Photo of the Day from National Geographic archives.

natgeo.getPhotoOfDay(`DAY` , `CALLBACK`)
    .then((result) => ...);

or

const result = await NationalGeographicAPI.getPhotoOfDay(`DAY` , `CALLBACK`);
  • DAY - optional, defaults to today. Expects ISO date format
  • CALLBACK - optional, if no callback provided returns a promise
2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.4.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago