atomically
atomically copied to clipboard
Read and write files atomically and reliably.
If a write has been initiated, and another 10 writes to the same path have got queued up in the meantime, it's possible that the computer will crash before finishing...
I use this library to safe user json config file. The full error is like: EXDEV: cross-device link not permitted, rename 'C:\Users\\AppData\Roaming\xmcl\user.json.tmp-48051806880cfebe' -> 'C:\Users\\AppData\Roaming\xmcl\user.json' I only observe this issue in...
Specify the license under which the project is available in the package.json so that it can be displayed on [npmjs.org](https://www.npmjs.com/package/atomically) and used by automated tooling for license compliance. See for...
If the `data` argument to `writeFile`/`writeFileAsync` is a `Readable` (from `node:stream`), then the contents of the stream are atomically `pipe`d to the new file. This is useful for handling file...
This gets rid of a vulnerability warning on `npm install`.
Atomically attempts to get the current UID and GID using multiple calls to `os.userInfo()` at import time: https://github.com/fabiospampinato/atomically/blob/6918c035a288094dc8d4339a2b28bdea20293dcb/src/constants.ts#L19-L21 [`os.userInfo()` calls `uv_os_get_passwd()`](https://github.com/nodejs/node/blob/5ef498517574e1534041cdd25c920f8d0b2cf845/src/node_os.cc#L290), which on UNIX-like systems [calls `uv__getpwuid_r(..., geteuid())`](https://github.com/nodejs/node/blob/5ef498517574e1534041cdd25c920f8d0b2cf845/deps/uv/src/unix/core.c#L1369-L1371), and looks...
Some tools like for example [LicenseFinder](https://github.com/pivotal/LicenseFinder) rely on the license property from package.json. If not present, the license is reported as unknown