1.0.6 • Published 4 years ago

parsetext2json v1.0.6

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

npm NPM npm

parseText2Json

This repository lets you easily parse any .txt file containing strings or numbers into a dictionary format (JSON Object) that counts the frequency of each word/ number.

How to use it?

  1. Run npm i parsetext2json in your project directory. See an example in the next step.

  2. Using Node.Js to run the code in index.js

    const parse = require('parsetext2json');
    
    const filePath = 'input.txt';
    const output = parse.parseString(filePath);
    console.log(output);
  3. The output should be like below:

    [ { value: 'What', count: 1 },
      { value: 'is', count: 2 },
      { value: 'Lorem', count: 5 },
      { value: 'Ipsum', count: 5 },
      { value: 'simply', count: 1 },
      { value: 'dummy', count: 2 },
      { value: 'text', count: 2 },
     				...
     				...
     				...
      { value: 'PageMaker', count: 1 },
      { value: 'including', count: 1 },
      { value: 'versions', count: 1 } ]
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago