read-file-to-array

1.0.5 • Public • Published

Future

Reads the specified file into ar 2D array

Installation

npm install read-file-to-array

Used

/** txt file
ducmaster01|123456aa
ducmaster02|123456aa
*/
const { ReadFileToArray } = require("read-file-to-array");

ReadFileToArray(
  "./acc_test.txt",
  ["username", "password"],
  "|",
  (err, accounts) => {
    console.log({ accounts });
    /*
        {
          accounts: [
            { username: 'ducmaster01', password: '123456aa' },
            { username: 'ducmaster02', password: '123456aa' } 
          ]
        }
    */
  }
);

or

const { ReadFileToArraySync } = require("read-file-to-array");

Package Sidebar

Install

npm i read-file-to-array

Weekly Downloads

2

Version

1.0.5

License

ISC

Unpacked Size

1.94 kB

Total Files

3

Last publish

Collaborators

  • nhayhoc