Bing Microsoft Translator
Using in Code
import { BingTranslator } from "@horat1us/bing-translator";
const translator = new BingTranslator({source: "en", target: "uk"});
translator.evaluate('Hello, World!')
.then((translated) => {
console.log(translated);
return translator.release();
})
.catch((error) => console.error(error));
CLI Package
npm i -g @horat1us/bing-translator
cat ~/document.txt | bing-translate
bing-translate
From sources
Local NodeJS and Chromium
Requires NodeJS >=12, Chrome installed.
git clone https://github.com/Horat1us/bing-translator.git
npm i
npm test
npm start
cat ./document.txt | npm start
Docker
docker run -w $PWD -v $PWD:$PWD -e BROWSER_ARGS="--no-sandbox" catsoss/node-headless-chrome:13.6.0-1 npm i
docker run -w $PWD -v $PWD:$PWD -e BROWSER_ARGS="--no-sandbox" catsoss/node-headless-chrome:13.6.0-1 npm test
docker run -it -w $PWD -v $PWD:$PWD -e BROWSER_ARGS="--no-sandbox" catsoss/node-headless-chrome:13.6.0-1 npm start
docker run -it -w $PWD -v $PWD:$PWD -e BROWSER_ARGS="--no-sandbox" catsoss/node-headless-chrome:13.6.0-1 bash -c "cat ./document.txt | npm start"