JSPM

  • Created
  • Published
  • Downloads 235
  • Score
    100M100P100Q81541F
  • License ISC

google translate api page

Package Exports

  • translate-api

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (translate-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

translate-api

A Node.js module for working with the Google Translation. Automatically handles bulk translations that exceed the Google Translation API query limit.

DEMO

http://translate.witbag.cn/

google translate

Npm Module

Install

  $ npm install translate-api --save

Example

  const translate = require('translate-api');

  let transUrl = 'https://nodejs.org/en/';
  translate.getPage(transUrl).then(function(htmlStr){
    console.log(htmlStr.length)
  });

  let transText = 'hello world!';
  translate.getText(transText,{to: 'zh-CN'}).then(function(text){
    console.log(text)
  });