nearStarByNamefunction
A system by a name, ignoring case and extra spaces: its name (Proxima Centauri, Alpha Centauri), its Japanese name, its designation or any name of its stars or the sources (Rigil Kentaurus, Sirius B, GJ 876).
Import it
import { nearStarByName } from "@johnmorrisdotca/hoshi-stars/near-stars";
Definition
function nearStarByName(text: string): NearStar | undefined
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The name. |
Returns
NearStar | undefined
The system, or undefined.
Examples
import { nearStarByName } from "@johnmorrisdotca/hoshi-stars/near-stars";
console.log(nearStarByName("Sirius B")?.name, nearStarByName("barnard's star")?.lightYears.toFixed(1));Sirius 6.0What it prints (run when this page was built)