1.1.33 • Published 5 years ago

@medicus.ai/megatron-interface-nodejs v1.1.33

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
5 years ago

megatron interface

set up

npm i
npm run build
# npm login --registry=https://npm-registory.dev.medicus.ai
npm publish --registry=https://npm-registory.dev.medicus.ai

usage

# replace $VERSION with latest version, you can find latest version here https://npm-registory.dev.medicus.ai/-/web/detail/@medicusai/megatron-interface-nodejs VERSIONS tab
npm i https://npm-registory.dev.medicus.ai/@medicusai/megatron-interface-nodejs/-/megatron-interface-nodejs-$VERSION.tgz
// work for both node and browser
const { pdf2txt, ocr, translate } = require('@medicusai/megatron-interface-nodejs')

module.exports.processPdf = async (base64) => {
  const text = await pdf2txt(base64)
  const en = await translate(text)
  return en
}

// browser only
import { file2base64 } from '@medicusai/megatron-interface-nodejs/dist/browser'
file2base64(input.files[0]).then(base64=>console.log(base64))

// node only
import { file2base64 } from '@medicusai/megatron-interface-nodejs/dist/node'
file2base64('/tmp/test.jpg').then(base64=>console.log(base64))
1.1.33

5 years ago

1.1.32

5 years ago

1.1.31

5 years ago

1.1.30

5 years ago