JerryFZhang / LaunchLib-js

NPM package for wrapping Launch Library (https://launchlibrary.net/docs/1.4.1/api.html)
MIT License
4 stars 0 forks source link
launch launchlibrary library node npm npm-package

LaunchLib-js

NPM version NPM downloads MIT License Travis Codacy Badge Dependency Status devDependency Status Coverage Status License

Unofficial NPM package for wrapping Launch Library (https://launchlibrary.net)

Usage

Install

npm install --save launchlib-js

Import

const Launch = require('launchlib-js')

const LaunchLib = new Launch()

Examples

LaunchLib takes two parameters, a function name, and a variable, then returns the result depends on the parameters passed in. LaunchLib.get(functionName, var).then(data => {...})

LaunchLib.get('getLaunches', '12')
    .then(data => { 
        // do something
    })
    .catch(err => { 
        // handle error
    }) 

The above call will return next 12 upcoming launches.

Supported Request Types and Parameters (total of 33)

Agency

getAgencyById

getAgencyByAbbr

Agency Type

getAgencyTypeById

getAgencyTypeByName

Event Type

getEventTypeById

getEventTypeByName

Launch

getLaunchById

getLaunchByName

getLaunches

getLaunchesAfter

getLaunchesBetween

Launch Status

getLaunchStatusById

Location

getLocationById

Mission

getMissionById

Mission Event

getMissionEventById

Mission Type

getMissionTypeById

Pad

getPadById

Rocket Event

getRocketById

Rocket Family

getRocketFamilyById

Example App

Click here to see a React + Node.js exmaple of launchlib-js

License

LaunchLib-js is freely distributable under the terms of the MIT license.