Gathering detailed insights and metrics for @digidem/fs-write-stream-atomic
Gathering detailed insights and metrics for @digidem/fs-write-stream-atomic
Gathering detailed insights and metrics for @digidem/fs-write-stream-atomic
Gathering detailed insights and metrics for @digidem/fs-write-stream-atomic
Like `fs.createWriteStream(...)`, but atomic.
npm install @digidem/fs-write-stream-atomic
Typescript
Module System
Node Version
NPM Version
71.2
Supply Chain
76.9
Quality
78.9
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
22,984
Last Day
1
Last Week
2
Last Month
22
Last Year
423
ISC License
49 Stars
44 Commits
16 Forks
24 Watchers
4 Branches
111 Contributors
Updated on May 27, 2024
Minified
Minified + Gzipped
Latest Version
1.1.0
Package Id
@digidem/fs-write-stream-atomic@1.1.0
Unpacked Size
18.60 kB
Size
5.52 kB
File Count
11
NPM Version
6.1.0
Node Version
8.11.1
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-80%
2
Compared to previous week
Last Month
-15.4%
22
Compared to previous month
Last Year
-64.2%
423
Compared to previous year
4
Like fs.createWriteStream(...)
, but atomic.
Writes to a tmp file and does an atomic fs.rename
to move it into
place when it's done.
First rule of debugging: It's always a race condition.
1var fsWriteStreamAtomic = require('fs-write-stream-atomic') 2// options are optional. 3var write = fsWriteStreamAtomic('output.txt', options) 4var read = fs.createReadStream('input.txt') 5read.pipe(write) 6 7// When the write stream emits a 'finish' or 'close' event, 8// you can be sure that it is moved into place, and contains 9// all the bytes that were written to it, even if something else 10// was writing to `output.txt` at the same time.
fsWriteStreamAtomic(filename, [options])
filename
{String} The file we want to write tooptions
{Object}
chown
{Object} User and group to set ownership after write
uid
{Number}gid
{Number}encoding
{String} default = 'utf8'mode
{Number} default = 0666
flags
{String} default = 'w'
getTmpname
{Function} Custom function for generating a tmp name for the file as it is being copied. Passed the filename as the argument, should return a string valid filename. Default blob/custom-tmp-name/index.js#L16-L19No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/24 approved changesets -- score normalized to 0
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
61 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-09
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More