const Kuroshiro = require("kuroshiro")
const KuromojiAnalyzer = require("kuroshiro-analyzer-kuromoji");
const sp = require('synchronized-promise')
//console.log(Kuroshiro)
const kuroshiro = new Kuroshiro();
let syncFunc = sp(sample)
const value = syncFunc("名無しの権兵衛")
console.log(value)
async function sample(str) {
try {
await kuroshiro.init(new KuromojiAnalyzer())
let val = await kuroshiro.convert(str, {
romajiSystem:"passport", to:"romaji",
})
//console.error(val);
return val
} catch (err) {
console.error(err);
}
}