npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aerolib

v1.0.7

Published

A library made by my self to utilize NASA'S api in to any js backends or any other js libraries

Readme

NOTE:

in .env use "key=DEMO_KEY" for the test purpose

APOD and Near-Earth Asteroid Information - NASA API

This repository utilizes NASA's API to fetch two sets of data:

  1. Astronomy Picture of the Day (APOD)
  2. Near-Earth Asteroid Information (NeoWs)

Installation

To use the APOD and Near-Earth Asteroid functionalities, install the aerolib package from npm:

npm i aerolib

Link to aerolib package on npm

Example Usage

  1. Astronomy Picture of the Day (APOD) The APOD function retrieves data related to NASA's Astronomy Picture of the Day, including the image, explanation, and other metadata.

    Using async/await

    const aerolib = require('aerolib');
    
    async function getAPOD() {
        const data = await aerolib.getAPODdata();
        console.log(data.copyright);
        console.log(data.date);
        console.log(data.explanation);
    }
    
    getAPOD();

    Using Promises

    aerolib.getAPODdata().then((data) => {
        console.log(data.copyright);
        console.log(data.date);
        console.log(data.explanation);
    });

    Available Data:

    • copyright: Copyright signature for the image.
    • date: Date of the photography.
    • explanation: A brief explanation of the picture.
    • hdurl: The URL for the HD version of the image.
    • media_type: Type of media (image, video, etc.).
    • service_version: Version of the service.
    • title: Title of the image.
    • url: URL for the image.
  2. Near-Earth Asteroid Information (NeoWs) The Near-Earth Object Web Service (NeoWs) allows you to fetch data on asteroids that are near Earth.

    Fetch Asteroid Count for a Date Range

    aerolib.NeoWselementcount("2015-09-07", "2015-09-08")
        .then((count) => {
            console.log(count);
        });

    Fetch Near-Earth Objects for a Date Range

         aerolib.near_earth_objects("2015-09-07", "2015-09-08").then((data) => {
             data.forEach((d) => {
                 console.log(d.links)
                 console.log(d.id)
                 console.log(d.neo_reference_id)
                 console.log(d.name)
                 console.log(d.nasa_jpl_url)
             })
         })

    Example Data:

    {
      "links": {
        "self": "http://api.nasa.gov/neo/rest/v1/neo/54393994?api_key=FOc8xoEW6vTQSTbSt4ZegBsELglcpQS5Hqkcn7fd"
      },
      "id": "54393994",
      "neo_reference_id": "54393994",
      "name": "(2023 TP16)",
      "nasa_jpl_url": "https://ssd.jpl.nasa.gov/tools/sbdb_lookup.html#/?sstr=54393994",
      "absolute_magnitude_h": 29.78,
      "estimated_diameter": {
        "kilometers": {
          "estimated_diameter_min": 0.002941406,
          "estimated_diameter_max": 0.0065771838
        },
        "meters": {
          "estimated_diameter_min": 2.9414060178,
          "estimated_diameter_max": 6.5771838053
        },
        "miles": {
          "estimated_diameter_min": 0.0018277044,
          "estimated_diameter_max": 0.0040868713
        },
        "feet": {
          "estimated_diameter_min": 9.6502825195,
          "estimated_diameter_max": 21.5786877156
        }
      },
      "is_potentially_hazardous_asteroid": false,
      "close_approach_data": [
        {
          "close_approach_date": "2015-09-08",
          "close_approach_date_full": "2015-Sep-08 09:00",
          "epoch_date_close_approach": 1441702800000,
          "orbiting_body": "Earth"
        }
      ]
    }

    Explanation of Data Fields:

    • links.self: URL to access detailed information about this specific asteroid from NASA's Near-Earth Object (NEO) API.
    • id: The unique identifier for this asteroid in the NASA database.
    • neo_reference_id: A reference ID, often identical to the id.
    • name: The name of the asteroid (usually based on the year of discovery).
    • nasa_jpl_url: URL to NASA's JPL Small Body Database for more detailed information.
    • absolute_magnitude_h: The asteroid's brightness, with lower values indicating a brighter object.
    • estimated_diameter: Estimated size of the asteroid in multiple units (kilometers, meters, miles, feet).
    • is_potentially_hazardous_asteroid: Boolean value indicating whether the asteroid is potentially hazardous to Earth.
    • close_approach_data: Array of objects with details about the asteroid's closest approach to Earth.

Mars Rover Photos