Skip to the content

Hoshi Stars星

The stars you can see without a telescope, with names, colours and distances; the 88 constellations with their lines and boundaries; the Messier objects; and seven map projections to draw them on.

Hoshi is the Japanese word 星 for a star. About the name

Contents

Reference · A names index for a search box: a row for each bright star and Messier object with its names in English and Japanese, designations, constellation, rank weight, an address-safe id and where to point, with lookup by id and by name

NameIndextype

What an index of rows offers: the rows, one by id, one by any name, and a ranked search.

Import it

import type { NameIndex } from "@johnmorrisdotca/hoshi-stars/names";

Also exported from: @johnmorrisdotca/hoshi-stars/names/named, @johnmorrisdotca/hoshi-stars/names/ngc-ic

Definition

interface NameIndex {
    rows(kinds?: readonly NameKind[]): NameRow[];
    byId(id: string): NameRow | undefined;
    find(text: string): NameRow | undefined;
    search(text: string, options?: {
        limit?: number;
        kinds?: readonly NameKind[];
    }): NameRow[];
}

Members

NameTypeDescription
rows(kinds?: readonly NameKind[]): NameRow[]

The rows, brightest and best-known first, as a fresh array.

byId(id: string): NameRow | undefined

The row with that id, or undefined.

find(text: string): NameRow | undefined

The row a text names exactly (ignoring case, spacing, accents and the Greek letter's spelling), or undefined if none or more than one does.

search(text: string, options?: { limit?: number; kinds?: readonly NameKind[]; }): NameRow[]

The rows whose names match: those that start with the text first, then those that contain it, each by weight; at most limit (20 by default).

Examples

import { searchNames, type NameIndex } from "@johnmorrisdotca/hoshi-stars/names";

const found: ReturnType<NameIndex["search"]> = searchNames("andromeda", { limit: 3 });
console.log(found.map((row) => row.id));
[ 'm31', 'alpheratz', 'mirach' ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hoshi-stars 0.47.0.