Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including hyphenopoly with all npm packages installed. Try it out:

// For RunKit: // import hyphenopoly from "hyphenopoly"; import hyphenopoly from "../hyphenopoly.module.js"; // For local node: // import hyphenopoly from "../hyphenopoly.module.js"; const hyphenator = hyphenopoly.config({ "exceptions": { "en-us": "en-han-ces" }, "hyphen": "•", "loader": async (file) => { const {readFile} = await import("node:fs/promises"); const {dirname} = await import("node:path"); const {fileURLToPath} = await import("node:url"); const cwd = dirname(fileURLToPath(import.meta.url)); return readFile(`${cwd}/../patterns/${file}`); }, "require": ["de", "en-us"] }); async function hyphenateEn(text) { const hyphenateText = await hyphenator.get("en-us"); console.log(hyphenateText(text)); } async function hyphenateDe(text) { const hyphenateText = await hyphenator.get("de"); console.log(hyphenateText(text)); } hyphenateEn("hyphenation enhances justification."); hyphenateDe("Silbentrennung verbessert den Blocksatz.");

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

hyphenopoly v5.2.1

Hyphenation for node and Polyfill for client-side hyphenation.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free