Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@file-services/overlay
Advanced tools
Overlay files and directories from one file system on top of another.
Overlay files and directories from one file system on top of another.
Overlay file system allows taking a native node file system ("lower fs") and overlay files and directories from an in-memory file system ("higher fs"). It can be used as a virtual layer providing a solution for storing and manipulating temporary data.
Read operations (readFile
, readdir
, stat
, etc.) are checking higher fs first, and fallback to lower fs.
Currently, all write operations go directly to the original lower fs.
Install library in project:
npm i @file-services/overlay
Then, use the programmatic API:
import { createOverlayFs } from "@file-services/overlay";
import { createMemoryFs } from "@file-services/memory";
import { nodeFs } from "@file-services/node";
const memFs = createMemoryFs({
src: {
"a.txt": `A`,
"b.txt": `B`,
},
});
const overlayFs = createOverlayFs(nodeFs /* lower fs */, memFs /* higher fs */);
// overlayFs.readFileSync('src/a.txt', 'utf8') === 'A'
createOverlayFs
also accepts a directory path as third parameter which specifies which directory in lower fs should be overlaid upon (defaults to lowerFs.cwd()
). This is important when overlaying a memory fs over native node fs and running on Windows. Memory fs uses posix-style paths, so the base directory is where memory's root /
begins to overlay.
MIT
FAQs
Overlay files and directories from one file system on top of another.
The npm package @file-services/overlay receives a total of 695 weekly downloads. As such, @file-services/overlay popularity was classified as not popular.
We found that @file-services/overlay demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.