🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

anyfileparser

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

anyfileparser

Node.JS library that can parse text from any kind of file, eg. text, image, pdf, office files.

1.1.1
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

anyFileParser

Node.JS library that can parse text from any kind of file, eg. text, image, pdf, office files.

Update

  • 2019/06/17 - Added method to change location for decompressing office files in places with restricted write access.
  • 2019/05/02 - Initial module with pdf, image, utf-8 and office files.

Install via npm

npm i anyfileparser

Usage

const anyFileParser = require('anyfileparser');

anyFileParser.parseFile("/path/to/file", function(data){
        // "data" string in the callback here is the text parsed from the file passed in the first argument above
        console.log(data)
})

Optionally change decompression location for office Files at persionalised locations for environments with restricted write access

const anyFileParser = require('anyfileparser');

// Default decompress location for office Files is "officeDist" in the directory where Node is started. 
// Put this file before parseOffice method to take effect.
anyFileParser.setDecompressionLocation("/tmp");  // New decompression location would be "/tmp/officeDist"

// P.S.: Setting location on a Windows environment with '\' heirarchy requires to be entered twice '\\'
anyFileParser.setDecompressionLocation("C:\\tmp");  // New decompression location would be "C:\tmp\officeDist"

anyFileParser.parseFile("/path/to/file", function(data){
        // "data" string in the callback here is the text parsed from the file passed in the first argument above
        console.log(data)
})

Example

const anyFileParser = require('anyfileparser');

anyFileParser.parseFile("C:\\files\\myText.docx", function(data){
        var newText = data + "look, I can parse any file"
        callSomeOtherFunction(newText);
})

// Using relative path for file is also fine
anyFileParser.parseFile("files/myWorkSheet.ods", function(data){
        var newText = data + "look, I can parse any file"
        callSomeOtherFunction(newText);
})

Keywords

image

FAQs

Package last updated on 18 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts