{"_id":"@azure/cognitiveservices-translatortext","_rev":"7-a6cda3baf1dd05a40704411a597603d4","name":"@azure/cognitiveservices-translatortext","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@azure/cognitiveservices-translatortext","version":"1.0.0","keywords":["node","azure","typescript","browser","isomorphic"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/cognitiveservices-translatortext@1.0.0","maintainers":[{"name":"mikeharder","email":"mharder@microsoft.com"},{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/cognitiveservices/cognitiveservices-translatortext","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"4034c6a3dcb73b15288fbae2b3d0f7525cfa0ea6","tarball":"https://registry.npmjs.org/@azure/cognitiveservices-translatortext/-/cognitiveservices-translatortext-1.0.0.tgz","fileCount":49,"integrity":"sha512-sPbzDbZxGjkWMgfhr8BWe+oTH4DvhoN1aC3Eg4Mq+yi3up4d0Iogq/up2GmUtXTTqLbuVFxJu3CHkHcXz2JPDQ==","signatures":[{"sig":"MEYCIQD4MiZQrZou5gACtqd9mV3sjGprhiuCsIts/cemXfVCBQIhAPZK48Twi23s4nSd8HzvIaHsPY4PMVFQ63i69c58ik5E","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":598866,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdeS/0CRA9TVsSAnZWagAAaCUP/30oNCpv0ZAWQifW5Slk\naPPNM16r2auu5UZeNmkxy6OFmRBv8+SVcGV6x3h+2z6Ad0dLJ2A61YEmwXKo\nHR3R8jjF5fbxZPmp6wLwfUMnkMFa9h2bQZdgTanrAe51StzQqe6BzamXoX2l\nkN28mMZBHORTKHdnJ0yGZH0p+YWUwnI0GgvaMgWv6BGAU/AGG+Lv5a08GPWZ\ncroE7t3hDwuXwv8KoQrTswxIN0JXOzthiIiJgyxxgOvH1vJbDge0btbzV72Q\nsu/OcdWJgu5FNgn4GIneUsG9BOqva338mTw6nZ4FUEtiBsCZ0bKbroSnKT9T\noUlJS1NOm10+yHBZEUQdRyTRxdWxCNi8HL/Xp3AYy2IYzkqDQ5g4rULJZ6bR\njn0mPvUCuo8FI+Rkd05S1SUChdwfkB7vjOSXCjsQRdkiJYLWjEC/Gxe2vcPD\nkejRWe3bCbAOT2KK7su0EbNEJ5VSbZAE5rvOK+uRdnOdES527dwbJ4X/MCXP\ngM5Ft01Z9LwKfzA9+fFD8PKpYbjEAaRtBUF+tTVRhrBrL2mAx/VAJfD9nPpK\njvOKaqMm9+MfbSCgLDXVQPKaO2KUtX1dmSzs25RCEJ0D8ikCJtXI4zqxjxww\n1IKv+maI8MbxoD46ZhirdYgb+4KallqPqWVXmoZDty9OehqJXHoLusNlr1nl\nRXX4\r\n=QRWR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cognitiveservices-translatortext.js","_from":"file:/home/vsts/work/r1/a/_js - mgmt - ci/drop/azure-cognitiveservices-translatortext-1.0.0.tgz","types":"./esm/translatorTextClient.d.ts","module":"./esm/translatorTextClient.js","scripts":{"build":"tsc && rollup -c rollup.config.js && npm run minify","minify":"uglifyjs -c -m --comments --source-map \"content='./dist/cognitiveservices-translatortext.js.map'\" -o ./dist/cognitiveservices-translatortext.min.js ./dist/cognitiveservices-translatortext.js","prepack":"npm install && npm run build"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"_resolved":"","_integrity":"","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.9.0","autoPublish":true,"description":"TranslatorTextClient Library with typescript type definitions for node.js and browser.","directories":{},"sideEffects":false,"_nodeVersion":"10.16.3","dependencies":{"tslib":"^1.10.0","@azure/ms-rest-js":"^2.0.4"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^1.18.0","uglify-js":"^3.6.0","typescript":"^3.5.3","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-node-resolve":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/cognitiveservices-translatortext_1.0.0_1568223219249_0.33137710976270784","host":"s3://npm-registry-packages"},"deprecated":"This package has been deprecated and replaced by @azure-rest/ai-translation-text"},"1.0.1":{"name":"@azure/cognitiveservices-translatortext","version":"1.0.1","keywords":["node","azure","typescript","browser","isomorphic"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/cognitiveservices-translatortext@1.0.1","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/cognitiveservices/cognitiveservices-translatortext","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"888442c3e297677de36887fb325100a27152d025","tarball":"https://registry.npmjs.org/@azure/cognitiveservices-translatortext/-/cognitiveservices-translatortext-1.0.1.tgz","fileCount":49,"integrity":"sha512-ByOcyqLKFlpgHhkEw44dV9DecmI+r+FZIh72eFwGx8NZLr0erSkknkUJwS/reZgejG0nGevfqM6Sow8Zat29Xw==","signatures":[{"sig":"MEQCIENRTTtTm/zooujM3vczkBJXG9kX8rfpNlLq/RlZKVs5AiB5CDIDpAKN4FT9sdFGqQ4rQnGCaDWenhIJPZlsxOHBvw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":599825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH2cWCRA9TVsSAnZWagAAkJUP/2UhFz8GukKtjY144n7K\nYswGyyGaoNJYti6Bs/d1ZLT0BZUNwctMKacorxzRYaakqmewYSJOylIWyAzR\n70IwwDgJ43hGJ7KXpOnEMX64dLOprjH34zGAOfyQub8DsTbTgHQXB4/3R5jW\nHAy9LmxxXaWdDrzfMhG1/KGZ96ipcw8ZHXgSb+Sfkok66Yp6d1sD1mvA9WHZ\nhOFXWw06noXbU6UiGk9uPENf3CHzbdWEvF5d24xzF+IF5GnljrOgzMJ1ltSX\nVJKVwTF1jfzoAGnx2KoJ4jPbzsuv/qGSZeKfhvkYIcqczD6EQaokjmxlaygl\nNAvdTyra/Vkdcoa5C4EWOBrickBxPfMdM7H/TpG7E5jnTEfkf9VShYRH5jvi\nxdFGojdVR8V09Dzf4AGddLdGUjsCD07LeE/VZdrvn828/Aw3mOkcD4pUG3Xi\nrE2qZJ8L6kY55rPhFGbyXbOXXVWJDeJtetd5Nn/e8z5vjes57o3J4YKQ6vH3\nuLJ8aL0t86qUAIJ1R/5qr0AGBvIxmKVGoDdhr3lJVwpIBQwWkL/byr9/w+J1\nA01jAbvewvsQMSM8/ugW9SPXRGzpK/B9Gj/sjnSA5dEgS8loTrwRbIQB4q28\nlJCW9LsomfA+JQp0cd/pgNvN03f/DTnWiBSSJuHcetHKLAXuh1VtLtBq4CiQ\n8l76\r\n=ad/J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/cognitiveservices-translatortext.js","_from":"file:/home/vsts/work/r1/a/_js - mgmt - ci/drop/azure-cognitiveservices-translatortext-1.0.1.tgz","types":"./esm/translatorTextClient.d.ts","module":"./esm/translatorTextClient.js","scripts":{"build":"tsc && rollup -c rollup.config.js && npm run minify","minify":"uglifyjs -c -m --comments --source-map \"content='./dist/cognitiveservices-translatortext.js.map'\" -o ./dist/cognitiveservices-translatortext.min.js ./dist/cognitiveservices-translatortext.js","prepack":"npm install && npm run build"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"_resolved":"","_integrity":"","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.4","autoPublish":true,"description":"TranslatorTextClient Library with typescript type definitions for node.js and browser.","directories":{},"sideEffects":false,"_nodeVersion":"10.21.0","dependencies":{"tslib":"^1.10.0","@azure/ms-rest-js":"^2.0.4"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^1.18.0","uglify-js":"^3.6.0","typescript":"^3.5.3","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-node-resolve":"^5.2.0"},"_npmOperationalInternal":{"tmp":"tmp/cognitiveservices-translatortext_1.0.1_1595893526368_0.279330912992402","host":"s3://npm-registry-packages"},"deprecated":"This package has been deprecated and replaced by @azure-rest/ai-translation-text"}},"time":{"created":"2019-09-11T17:33:39.054Z","modified":"2026-04-03T21:15:37.768Z","1.0.0":"2019-09-11T17:33:39.501Z","1.0.1":"2020-07-27T23:45:26.518Z"},"bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"author":{"name":"Microsoft Corporation"},"license":"MIT","homepage":"https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/cognitiveservices/cognitiveservices-translatortext","keywords":["node","azure","typescript","browser","isomorphic"],"repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"description":"TranslatorTextClient Library with typescript type definitions for node.js and browser.","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},{"name":"microsoft-oss-releases","email":"microsoft-oss-publishing@microsoft.com"},{"name":"microsoft1es","email":"npmjs@microsoft.com"}],"readme":"## An isomorphic javascript sdk for - TranslatorTextClient\n\nThis package contains an isomorphic SDK for TranslatorTextClient.\n\n### Currently supported environments\n\n- Node.js version 6.x.x or higher\n- Browser JavaScript\n\n### How to Install\n\n```bash\nnpm install @azure/cognitiveservices-translatortext\n```\n\n### How to use\n\n#### nodejs - Authentication, client creation and languages translator as an example written in TypeScript.\n\n##### Install @azure/ms-rest-azure-js\n\n```bash\nnpm install @azure/ms-rest-azure-js\n```\n\n##### Sample code\nThe following sample translates the given text which is in Chinese to English. To know more, refer to the [Azure Documentation on Translator](https://docs.microsoft.com/en-us/azure/cognitive-services/translator/)\n\n```javascript\nconst { TranslatorTextClient } = require(\"@azure/cognitiveservices-translatortext\");\nconst { CognitiveServicesCredentials } = require(\"@azure/ms-rest-azure-js\");\n\nasync function main() {\n  const translatorTextKey =\n    process.env[\"translatorTextKey\"] || \"<translatorTextKey>\";\n  const translatorTextEndPoint =\n    process.env[\"translatorTextEndPoint\"] || \"<translatorTextEndPoint>\";\n  const cognitiveServiceCredentials = new CognitiveServicesCredentials(\n    translatorTextKey\n  );\n  const client = new TranslatorTextClient(\n    cognitiveServiceCredentials,\n    translatorTextEndPoint\n  );\n\n  const text = [\n    {\n      text: \"你好，世界\"\n    }\n  ];\n\n  client.translator\n    .detect(text)\n    .then(result => {\n      console.log(\"The result is: \");\n      console.log(result);\n    })\n    .catch(err => {\n      console.log(\"An error occurred:\");\n      console.error(err);\n    });\n}\n\nmain();\n```\n\n#### browser - Authentication, client creation and languages translator as an example written in JavaScript.\n\n##### Sample code\n\n- index.html\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>@azure/cognitiveservices-translatortext sample</title>\n    <script src=\"node_modules/@azure/ms-rest-js/dist/msRest.browser.js\"></script>\n    <script src=\"node_modules/@azure/cognitiveservices-translatortext/dist/cognitiveservices-translatortext.js\"></script>\n    <script type=\"text/javascript\">\n      const translatorTextKey = \"<YOUR_TRANSLATOR_TEXT_KEY>\";\n      const translatorTextEndPoint = \"<YOUR_TRANSLATOR_TEXT_ENDPOINT>\";\n\n      const cognitiveServiceCredentials = new msRest.ApiKeyCredentials({\n        inHeader: {\n          \"Ocp-Apim-Subscription-Key\": translatorTextKey\n        }\n      });\n      const client = new Azure.CognitiveservicesTranslatortext.TranslatorTextClient(\n        cognitiveServiceCredentials,\n        translatorTextEndPoint\n      );\n\n      const text = [\n        {\n          text: \"你好，世界\"\n        }\n      ];\n\n      client.translator\n        .detect(text)\n        .then(result => {\n          console.log(\"The result is: \");\n          console.log(result);\n        })\n        .catch(err => {\n          console.log(\"An error occurred:\");\n          console.error(err);\n        });\n    </script>\n  </head>\n  <body></body>\n</html>\n```\n\n## Related projects\n\n- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcognitiveservices%2Fcognitiveservices-translatortext%2FREADME.png)\n","readmeFilename":"README.md"}