at

any-text

Get text content from any file

Showing:

Popularity

Downloads/wk

892

GitHub Stars

10

Maintenance

Last Commit

6mos ago

Contributors

1

Package

Dependencies

4

Size (min+gzip)

654.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Any-Text

Extract text content from a file.

Supported File Extensions

  • DOC
  • DOCX
  • DOT
  • PDF
  • CSV
  • TXT
  • XLS
  • XLSX

How to use

  • Install the library as a dependency (/dev-dependency)
npm i -D any-text
  • Make use of the getText method to read the text content
var reader = require('any-text');

reader.getText(`path-to-file`).then(function (data) {
  console.log(data);
});
  • You can also use the async/await notation
var reader = require('any-text');

const text = await reader.getText(`path-to-file`);

console.log(text);

Sample Test

var reader = require('any-text');

const chai = require('chai');
const expect = chai.expect;

describe('file reader checks', () => {
  it('check docx file content', async () => {
    expect(
      await reader.getText(`${process.cwd()}/test/files/dummy.docx`)
    ).to.contains('Lorem ipsum');
  });
});

Tell me your issues

you can raise any issue here

Contribution

Any pull request is welcome.

If it works for you , give a Star! ⭐

- Copyright © 2020- Abhinaba Ghosh

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100