exampleSync.js 573 B

1234567891011121314151617181920212223242526
  1. /* eslint-env node */
  2. /* eslint no-console: 0 */
  3. "use strict";
  4. // For RunKit:
  5. const hyphenopoly = require("hyphenopoly");
  6. /*
  7. * For local node:
  8. * const hyphenopoly = require("./hyphenopoly.module.js");
  9. */
  10. const hyphenator = hyphenopoly.config({
  11. "exceptions": {
  12. "en-us": "en-han-ces"
  13. },
  14. "hyphen": "•",
  15. "require": ["de", "en-us"],
  16. "sync": true
  17. });
  18. const hy1 = hyphenator.get("en-us")("hyphenation enhances justification.");
  19. const hy2 = hyphenator.get("de")("Silbentrennung verbessert den Blocksatz.");
  20. console.log(hy1);
  21. console.log(hy2);