one-translator
v1.1.3
Published
A simple and practical way to translate texts and file texts!
Downloads
9
Readme
A simple and practical way to translate texts and file texts!
Usage
1. Require the one-translator
const { translate, translateFile } = require('one-translator').default
Using it
console.log(await translate(`from`, `to`, `text`))
translate(`from`, `to`, `text`).then((data) => {
console.log(data)
})
Translate Files
## Without saving
console.log(await translateFile('en', 'pt-br', 'teste.txt'))
## Saving
console.log(await translateFile('en', 'pt-br', 'teste.txt', {
save: true,
savePath: './text2.txt'
}))
save: boolean not required, default false
savePath: string not required, default your path