1.0.4 • Published 3 years ago
@subekti13/g-translate v1.0.4
G-Translate
Just another nodejs module to translate text from one language to another language. Its fetches data from google translate by the way.
How to Install
npm install @subekti13/g-translate
# or
yarn add @subekti13/g-translate
How to Use
const gtranslate = require("@subekti13/g-translate");
// its asyncronous
gtranslate.translate("Selamat Siang", {from:"id", to: "ja"})
.then((result) => {
console.log(result)
})
.catch(err => {
console.log(error)
});
// to get list of languages use this variable
console.log(gtranslate.languages)
Response Format
{
"targetText": "こんにちは",
"romanization": "Kon'nichiwa"
}