- Install the package
npm i @mgcodeur/super-translator@latest
- Import the module
import translate from '@mgcodeur/super-translator';
import translate from '@mgcodeur/super-translator';
const result = await translate({
from: 'en',
to: 'es',
text: 'Hello World!'
});
console.log(result);
// output: Hola mundo
Example:
import translate from '@mgcodeur/super-translator';
const result = await translate({
to: 'ja',
text: 'Hello World!'
});
console.log(result);
// output: こんにちは世界
{
"type": "module"
...
}
You can run this with command:
node your-file.js