read-file-to-array
v1.0.5
Published
Reads the specified file into a 2D array
Downloads
8
Maintainers
Readme
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");