Unofficial NPM package for wrapping Launch Library (https://launchlibrary.net)
npm install --save launchlib-js
const Launch = require('launchlib-js')
const LaunchLib = new Launch()
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.
getAgencyById
getAgencyById
LaunchLib.get('getAgencyById', '1').then(data => {{...})
getAgencyByAbbr
getAgencyByAbbr
LaunchLib.get('getAgencyByAbbr', 'NASA').then(data => {{...})
getAgenciesByName
getAgenciesByName
LaunchLib.get('getAgenciesByName', 'National').then(data => {{...})
getAgencyTypeById
getAgencyTypeById
LaunchLib.get('getAgencyTypeById', '1').then(data => {{...})
getAgencyTypeByName
getAgencyTypeByName
LaunchLib.get('getAgencyTypeByName', 'government').then(data => {{...})
getEventTypeById
getEventTypeById
LaunchLib.get('getEventTypeById', '1').then(data => {{...})
getEventTypeByName
getEventTypeByName
LaunchLib.get('getEventTypeByName', 'info').then(data => {{...})
getLaunchById
getLaunchById
LaunchLib.get('getLaunchById', '1028').then(data => {{...})
getLaunchByName
getLaunchByName
LaunchLib.get('getLaunchByName', 'falcon').then(data => {{...})
getLaunches
getLaunches
LaunchLib.get('getLaunches', '5').then(data => {{...})
getLaunchesAfter
getLaunchesAfter
LaunchLib.get('getLaunchesAfter', '2015-08-20').then(data => {{...})
getLaunchesBetween
getLaunchesBetween
LaunchLib.get('getLaunchesBetween', {
"startDate": "2015-08-20",
"endDate": "2015-09-20"
}).then(data => {{...})
getLaunchEventById
getLaunchEventById
LaunchLib.get('getLaunchEventById', '1').then(data => {{...})
getLaunchStatusById
getLaunchStatusById
LaunchLib.get('getLaunchStatusById', '1').then(data => {{...})
getLaunchStatusByName
getLaunchStatusByName
LaunchLib.get('getLaunchStatusByName', 'GO').then(data => {{...})
getLocationById
getLocationById
LaunchLib.get('getLocationById', '1').then(data => {{...})
getLocationByName
getLocationByName
LaunchLib.get('getLocationByName', 'woomera').then(data => {{...})
getLocationByCountryCode
getLocationByCountryCode
LaunchLib.get('getLocationByCountryCode', 'USA').then(data => {{...})
getMissionById
getMissionById
LaunchLib.get('getMissionById', '601').then(data => {{...})
getMissionByName
getMissionByName
LaunchLib.get('getMissionByName', 'GPS').then(data => {{...})
getMissionEventById
getMissionEventById
LaunchLib.get('getMissionEventById', '1').then(data => {{...})
getMissionEventByParentId
getMissionEventByParentId
LaunchLib.get('getMissionEventByParentId', '1').then(data => {{...})
getMissionTypeById
getMissionTypeById
LaunchLib.get('getMissionTypeById', '1').then(data => {{...})
getMissionTypeByName
getMissionTypeByName
LaunchLib.get('getMissionTypeByName', 'Earth Science').then(data => {{...})
getPadById
getPadById
LaunchLib.get('getPadById', '1').then(data => {{...})
getPadTypeByName
getPadTypeByName
LaunchLib.get('getPadTypeByName', 'launch complex').then(data => {{...})
getPadTypeByLocationId
getPadTypeByLocationId
LaunchLib.get('getPadTypeByLocationId', '1').then(data => {{...})
getRocketById
getRocketById
LaunchLib.get('getRocketById', '1').then(data => {{...})
getRocketTypeByName
getRocketTypeByName
LaunchLib.get('getRocketTypeByName', 'falcon').then(data => {{...})
getRocketTypeByConfigName
getRocketTypeByConfigName
LaunchLib.get('getRocketTypeByConfigName', 'v1.1').then(data => {{...})
getRocketEventById
getRocketEventById
LaunchLib.get('getRocketEventById', '10').then(data => {{...})
getRocketEventByLaunchId
getRocketEventByLaunchId
LaunchLib.get('getRocketEventByLaunchId', '1').then(data => {{...})
getRocketFamilyById
getRocketFamilyById
LaunchLib.get('getRocketFamilyById', '1').then(data => {{...})
Click here to see a React + Node.js exmaple of launchlib-js
LaunchLib-js is freely distributable under the terms of the MIT license.