I need to read a file in sharepoint document library from node js and store it in a variable. I can read .txt files using sharepoint rest api. sharepoint site/_api/web/ GetFileByServerRelativeUrl('/Shared%20Documents/s_C_locations.txt')/$value.But when I try to read .docx file it returns something as below:
PK!����]�[Content_Types].xml ��(����N�0E�H�C�-j\@B5e�c H���LZ�_�L��=�@��"Ҳ���s��鋳�$4�b?����B܍.{�"CR�T6x(�P�ww�y�8�c!�D�DJ�Sp
���J�Sįi"�ҏj��?�:xO=�5�pp��Y�.^��I�";{�X{B�h�VĤ�ɗ_\z�9G6{pj"�1��K"L�8W#6�cj��P�^�\�dJ
���z)��_���� Xml/item2.xmlPK-!�H���`customXml/itemProps1.xmlPK-!\�'"�(�acustomXml/_rels/item2.xml.relsPK-!���.j�ccustomXml/item3.xmlPK-!�^����<ecustomXml/itemProps3.xmlPK-!�U�j�OfdocProps/custom.xmlPK-!{���(�hcustomXml/_rels/item3.xml.relsPK��
Please help me to resolve it
textract
methods to extract from buffer or url – tinamou