Skip to content
greek conversion

@humanities/greek-conversion/core

Conversions that bring into a bundle only the formats and the options they are given: the functions of the main entry point, which take the names of formats, with readers and writers in their place.

Readers and writers are imported from the entry point of their format (greekReader and greekWriter from ./greek, and so on), presets from ./presets, as prepared options. Other options are prepared once with prepareOptions, which brings their validation into the bundle. A bundle that converts Greek into transliteration with a preset is then about half the size of one that imports convert() from the main entry point. The guide on smaller bundles (opens in a new tab) compares the cases: an application that reads and writes every format, or lets its users choose them, gains little, and a server none.

import { convert } from "@humanities/greek-conversion/core";
import { greekReader } from "@humanities/greek-conversion/greek";
import { iso843Type2 } from "@humanities/greek-conversion/presets";
import { transliterationWriter } from "@humanities/greek-conversion/transliteration";
convert("Θεσσαλονίκη", greekReader, transliterationWriter, iso843Type2);
// → Thessaloníki

Re-exports ConversionLoss


Re-exports ConversionLossCode


Re-exports ConversionOptions


Re-exports ConversionResult


Re-exports ConversionSpan


Re-exports Format


Re-exports OptionError


Re-exports PreparedOptions


Re-exports prepareOptions


Re-exports Preset


Re-exports SourceOptions