@mgcodeur/super-translator
v1.0.9
Published
Translate text from any language to any language for free using (Google Translate, DeepL, Yandex Translate, Bing Translator)
Downloads
6
Maintainers
Readme
Installation
- Install the package
npm i @mgcodeur/super-translator@latest
- Import the module
import translate from '@mgcodeur/super-translator';
Basic Usage
import translate from '@mgcodeur/super-translator';
const result = await translate({
from: 'en',
to: 'es',
text: 'Hello World!'
});
console.log(result);
// output: Hola mundo
Auto detect language
Nb: "from" is not required, if not specified, it will be automatically detected
Example:
import translate from '@mgcodeur/super-translator';
const result = await translate({
to: 'ja',
text: 'Hello World!'
});
console.log(result);
// output: こんにちは世界
Note: if "to" is not specified, it will be "en"
Don't forget to add type="module" in your package.json file
{
"type": "module"
...
}
You can run this with command:
node your-file.js