English phonemizer using CMUdict.
yard add phonemize
import { phonemize } from 'phonemize';
const text = 'Hello world!';
console.log(phonemize(text));
// hʌlˈoʊ wˈɝld!
console.log(phonemize(text, false));
// [ [ 'hʌlˈoʊ', 'hɛlˈoʊ' ], [ 'wˈɝld' ], [ '!' ] ]