Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
atomic-file-rw
Advanced tools
This module is meant as a replacement for atomic-file as it has better error handling on node and is faster in the browser.
The library is written to handle writing to a few number of files in a
safe manner. Concurrent writes to the same file are completed in the
order they are started. A temporary file with the same filename as the
original — with a suffix ~
— is employed to ensure atomicity.
Write a buffer to file and read it again:
const atomic = require('atomic-file-rw')
atomic.writeFile("test.txt", Buffer.from('GREETINGS'), (err, x) => {
atomic.readFile("test.txt", (err, buf) => {
console.log(buf.toString())
})
})
atomic.readFile(path[, options], callback)
Same arguments as Node.js's fs.readFile
, but in the browser the
options
is ignored.
atomic.writeFile(file, data[, options], callback)
Same arguments as Node.js's fs.writeFile
, but in the browser the
options
is ignored.
atomic.deleteFile(file, callback)
Same arguments as Node.js's fs.unlink
.
FAQs
<!-- SPDX-FileCopyrightText: 2021 Anders Rune Jensen
The npm package atomic-file-rw receives a total of 45 weekly downloads. As such, atomic-file-rw popularity was classified as not popular.
We found that atomic-file-rw 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.