SpaceX api

May 7, 2023 ยท View on GitHub

A JavaScript / TypeScript wrapper for fetching data from SpaceX api.

Installation

npm install spacex-api

Usage

See available methods

TypeScript

import { SpaceX } from 'spacex-api';

SpaceX
    .getLatestLaunch()
    .then(launch => alert(launch.mission_name))

JavaScript

var SpaceX = require('spacex-api').SpaceX;

SpaceX
    .getLatestLaunch()
    .then(launch => alert(launch.mission_name))

Limitations

  • Lib is using Fetch API, so Internet Explorer is not supported.

Thanks for