1.0.9 • Published 2 years ago

@mgcodeur/super-translator v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Installation

  1. Install the package
npm i @mgcodeur/super-translator@latest
  1. 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
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago