envitrans

A Node.js package that helps translating from English to Vietnamese and vice versa

Usage no npm install needed!

<script type="module">
  import envitrans from 'https://cdn.skypack.dev/envitrans';
</script>

README

envitrans

:speech_balloon: A Node.js package that helps translating from English to Vietnamese and vice versa.

Table of Contents

Installation

Using npm:

$ npm install envitrans

Using yarn:

$ yarn add envitrans

Methods

enToVi(content)

  • content: The content in English that you want to translate into Vietnamese.

viToEn(content)

  • content: The content in Vietnamese that you want to translate into English.

Examples

Import the package

NodeJS

const envitrans = require('envitrans');

ES6/ TypeScript

import envitrans from 'envitrans';

How to use

(async () => {
  try {
    const enToVi = await envitrans.enToVi(
      'Smartphone location data, often used by marketers, has been useful for studying the spread of the coronavirus. But the information raises troubling privacy questions.'
    );
    const viToEn = await envitrans.viToEn(
      'Hệ thống radar phát hiện trẻ bị bỏ quên trên xe của Tesla dùng cảm biến sóng milimet, hoạt động ở mức công suất cao. Công nghệ này có lợi thế hơn các hệ thống cảm biến hiện nay.'
    );

    console.log(enToVi);
    // { result: 'Dữ liệu vị trí điện thoại thông minh, thường được các nhà tiếp thị sử dụng, đã hữu ích cho việc nghiên cứu sự lan truyền của coronavirus. Nhưng thông tin làm dấy lên những câu hỏi về quyền riêng tư.' }

    console.log(viToEn);
    // { result: 'The radar system detects missing tesla cars using millimetre - wave sensors, operating at high capacity. This technology has more advantage than existing sensors.' }
  } catch (error) {
    console.log(error);
  }
})();

Author

Tien-Dzung Nguyen (KutieKat)

License

MIT