New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

markdown-translator

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown-translator

Directly translate markdown file using Azure Text Translate API

latest
Source
npmnpm
Version
0.4.5
Version published
Maintainers
1
Created
Source

Markdown Translator

其他语言:中文

Directly translate markdown file using Azure Text Translate API

Prerequisites

Get Text Translate API Key from Azure Cognitive Services

Quick Start

Use as cli

# install cli
npm install markdown-translator -g

# set key and region from Azure Text Translate API
md-translator set --key <your key>
md-translator set --region <your region>

# do translate
md-translator translate --src README.md --dest README.zh.md --to zh

# get more information
md-translator --help

Use as binaries

Run markdown-translator without Node environment

  • Update config.json with your Azure Text Translate API.
  • Run npm run dist:mac to build for macos and npm run dist:win for windows.
  • Run the dist binary files like cli, e.g, ./markdown-translator translate --src README.md --dest README.zh.md --to zh

Modify dist scripts according to your platform. Find more at here

Use as a module

# install module
npm install markdown-translator
const markdownTranslate = require('markdown-translator')
markdownTranslate({
  // Give either a filepath
  src: pathToSrcFile,
  // Or pass in the text directly
  text: markdownContent,

  from: languageToTranslateFrom,
  to: languageToTranslateTo,
  subscriptionKey: yourSubscriptionKey,
  region: theRegionOfYourAzureInstance,
}).then((res) => {
  // deal with result
})

Note that there are some opinionated defaults: from is by default 'en', to 'zh'. The region argument is optional.

Keywords

Azure

FAQs

Package last updated on 18 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts