npm.io
1.0.0 • Published 9 years ago

@datagica/datanote-service-file2text

Licence
ISC
Version
1.0.0
Deps
2
Vulns
0
Weekly
0

file2text

a micro service to convert a document to plain text

Usage

npm run start then POST a file to the micro-service using the right Content-Type.

Examples

Plain text
$ curl -i -X POST "http://localhost:3000" -H "Content-Type: text/plain" --data-binary "@tests/fixtures/test.txt"
PDF
$ curl -i -X POST "http://localhost:3000" -H "Content-Type: application/pdf" --data-binary "@tests/fixtures/test.pdf"

Doc

$ curl -i -X POST "http://localhost:3000" -H "Content-Type: application/msword" --data-binary "@tests/fixtures/test.doc"

Docx

$ curl -i -X POST "http://localhost:3000" -H "Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document" --data-binary "@tests/fixtures/test.docx"