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
import { … } from "@johnmorrisdotca/hoshi-stars/names";
135.7 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
deepSkyRow | function | The row of a deep-sky object. |
findName | function | The row a name, a designation or an id names exactly, ignoring case, spacing, accents and the Greek letter's spelling: Betelgeuse, alpha Ori, α Orionis, HR 2061, M31, Messier 31, NGC 224, Andromeda Galaxy, ベテルギウス. |
NAME_KINDS | constant | The kinds of row in the names index: star, cluster (open and globular), nebula (emission, reflection, planetary, supernova remnant), galaxy and other (an asterism, a double star Messier listed, a source that is none of those). |
nameIndex | function | An index over rows: by id, by exact name and by a ranked search. |
NameIndex | type | What an index of rows offers: the rows, one by id, one by any name, and a ranked search. |
nameKey | function | A text folded to compare, as findName does: lower case, no accents, Greek letters spelt out and one space, a superscript as its digit; M 31, Messier 31 and m31 give m31, NGC 0224 gives ngc224, HR 2061 and hr2061 give hr2061. |
NameKind | type | One kind of row: star, cluster, nebula, galaxy or other. |
NameRow | type | One row of the names index: a star or a deep-sky object with the names a search box would try, and where to turn the sky to it. |
nameRowById | function | One row by its id (betelgeuse, alpha-orionis, hr-1234, m31): the reverse of the id every row carries. |
nameRows | function | The rows of the index: the 5,080 bright stars and the 110 Messier objects, brightest and best-known first (by weight), as a fresh array of rows. |
searchNames | function | The rows whose names match what was typed: those with a name that starts with it first (an exact name before those), then those that contain it, each by weight (bright and well known first). |
slugOf | function | An address-safe id from a text: lower-case ASCII letters and digits in runs joined by one hyphen; an accent is dropped (Boötes gives bootes) and a Greek letter is spelt out (α1 Centauri gives alpha1-centauri). |