nearbyStarsfunction
The nearby stars, nearest first (the ones with no distance last). They are the stars of the Yale parallax catalogue that the 5,080 bright stars do not hold, so a star is never in both lists.
Import it
import { nearbyStars } from "@johnmorrisdotca/hoshi-stars/nearby";
Definition
function nearbyStars(options?: { magnitude?: number; maxRelativeError?: number; withDistance?: boolean; }): NearbyStar[]
Parameters
| Name | Type | Description |
|---|---|---|
options (optional) | { magnitude?: number; maxRelativeError?: number; withDistance?: boolean; } |
|
Returns
NearbyStar[]
A fresh array of the shared, frozen stars.
Examples
import { nearbyStars } from "@johnmorrisdotca/hoshi-stars/nearby";
const close = nearbyStars({ maxRelativeError: 0.05 }).filter((star) => star.lightYears! < 20);
console.log(close.length > 50, close[0]?.name);true Proxima CentauriWhat it prints (run when this page was built)