Reference · Stars: names, positions, distance and colour
starByNamefunction
A star by its common name (Sirius), its name in katakana (シリウス) or its designation (α CMa, 9 CMa), ignoring case.
Import it
import { starByName } from "@johnmorrisdotca/hoshi-stars";
Definition
function starByName(text: string): Star | undefined
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The name or designation. |
Returns
Star | undefined
The star, or undefined.
Examples
import { starByName } from "@johnmorrisdotca/hoshi-stars";
console.log(starByName("betelgeuse")?.designation, starByName("α Lyr")?.name, starByName("シリウス")?.hr);α Ori Vega 2491What it prints (run when this page was built)