
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
text-file-utils
Advanced tools
A small set of Text file utilities
This is a node.js project that aims provides a simple interface that allow developers to read and write CSV/Text/Json files.
yarn add text-file-utils
Read a file in the current directory ("test.csv") and retrieve its headers.
import path from 'path'
import { readCSV, readCSVHeaders } from 'text-file-utils'
var filepath = path.join(__dirname, "test.csv")
(async () => {
let content = await readCSV(filepath);
let headers = await readCSVHeaders(filepath);
// Output the results:
console.log('Content: ', content)
console.log('Headers: ', headers)
})()
readTextSync is a method that opens a text-file and return a list of non-empty lines as array.
let items = readTextSync(path)
Where path is the current path of the file you desire to open.
readCSV is a method that opens a CSV file and returns a list of items as an array of dicts (where the keys are the columns).
let items = await readCSV(path)
Where path is the current path of the CSV file you desire to open.
readCSVHeaders is a method that opens a CSV file and return a list of columns as a array of strings.
let columns = await readCSVHeaders(path)
Where path is the current path of the file you desire to open.
writeCSV is a method that stores a list of dicts into a CSV file and returns true if the operation was performed with no errors.
let wasStored = await writeCSV(path, data, headers?)
Where there are multiple params such as:
writeTextSync is a method that stores a list of dicts into a CSV file and returns true if the operation was performed with no errors.
let wasStored = writeTextSync(path, data)
Where there are multiple params such as:
writeJsonSync is a method that stores a list of dicts into a JSON file and returns true if the operation was performed with no errors.
let wasStored = writeJsonSync(path, data)
Where there are multiple params such as:
In case of any suggestion, you can open a pull request by yourself or send me an e-mail (daniel.dsfarias@gmail.com).
Thank you!
FAQs
> A small set of Text file utilities
We found that text-file-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.