Messier catalog API that provides data and images for all 110 Messier objects.
To download for Node.js, run:
$ npm install messier-api
After installing the package, import the library using require
or import
.
const messier = require('messier-api');
To access data on the Messier objects, access messier.data
or use messier.getMessier()
.
console.log(messier.data.M45.name);
console.log(messier.getMessier(45).name);
Attribute | Description | Code Example |
---|---|---|
messierNumber |
The Messier number of the object. |
|
name |
The common name of the Messier object. If none exists, NGC number or description is used instead. |
|
alternateNames |
An array of the object's alternate names. Most have no alternate names (empty array). |
|
NGC |
The New General Catalog (NGC) or Index Catalog (IC) of the Messier object. Some objects have none (undefined). |
|
type |
Classifies objects into 12 different types: |
|
constellation |
The name of the constellation the Messier object is in. |
|
rightAscension |
The right ascension of the Messier object. (hh:mm:ss.ss) |
|
declination |
The declination of the Messier object. (±dd:mm:ss.ss) |
|
magnitude |
The apparent magnitude of the Messier object. |
|
size |
The apparent dimensions of the Messier object in arcminutes (W' x H'). If elliptical, only the angular diameter is given (D'). |
|
distance |
The distance of the Messier object from Earth in light-years. |
|
viewingSeason |
The best season to view the Messier object from the Northern Hemisphere. |
|
viewingDifficulty |
How hard it is to view the Messier object, classified as either: |
|