exoplanetHostByNamefunction
A host by a name, ignoring case and extra spaces: its name, its Japanese name, the Archive's name for it (Proxima Cen) or the name of one of its planets (TRAPPIST-1 e).
Import it
import { exoplanetHostByName } from "@johnmorrisdotca/hoshi-stars/exoplanet-hosts";
Definition
function exoplanetHostByName(text: string): ExoplanetHost | undefined
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The name. |
Returns
ExoplanetHost | undefined
The host, or undefined.
Examples
import { exoplanetHostByName } from "@johnmorrisdotca/hoshi-stars/exoplanet-hosts";
console.log(exoplanetHostByName("trappist-1 e")?.name, exoplanetHostByName("Proxima Cen b")?.planetCount);TRAPPIST-1 2What it prints (run when this page was built)