Reference · Stars: names, positions, distance and colour
starsfunction
The stars to a magnitude, brightest first. The catalogue stops at magnitude 6.0, so the default is all 5,080.
Import it
import { stars } from "@johnmorrisdotca/hoshi-stars";
Definition
function stars(options?: { magnitude?: number; }): Star[]
Parameters
| Name | Type | Description |
|---|---|---|
options (optional) | { magnitude?: number; } |
|
Returns
Star[]
A fresh array of the shared, frozen stars.
Examples
import { stars } from "@johnmorrisdotca/hoshi-stars";
console.log(stars().length, stars({ magnitude: 2 }).map((s) => s.name ?? s.designation).slice(0, 3));5080 [ 'Sirius', 'Canopus', 'Arcturus' ]What it prints (run when this page was built)