one-translator
Version:
A simple and practical way to translate texts and file texts!
35 lines (27 loc) • 795 B
Markdown
A simple and practical way to translate texts and file texts!
```js
const { translate, translateFile } = require('one-translator').default
```
```js
console.log(await translate(`from`, `to`, `text`))
translate(`from`, `to`, `text`).then((data) => {
console.log(data)
})
```
```js
console.log(await translateFile('en', 'pt-br', 'teste.txt'))
```
```js
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``