
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
A lightweight package for manipulating an in-memory unix-like virtual file systems (vfs).
A lightweight package for manipulating an in-memory unix-like virtual file systems (vfs).
npm install vfilesys
const VirtualFileSystem = require('vfilesys')
const vfs = new VirtualFileSystem()
vfs.write('/some/file.txt', 'My data')
vfs.export('./somewhere/backup.json', 'json')
vfs.import('./somewhere/other-backup.json')
vfs.virtualize('./somewhere/')
vfs.exists(path: string): boolean
Verifies the existence of a file under the selected virtual file system.
vfs.isFile(path: string): boolean
Verifies whether an item in the virtual file system exists and is a file.
vfs.isDirectory(path: string): boolean
Verifies whether an item in the virtual file system exists and is a directory.
vfs.isEmptyDirectory(path: string): boolean
Verifies whether an item in the virtual file system exists and is an empty directory.
vfs.read(path: string, encoding?: string): buffer|string
Reads a file and returns its contents. If 'encoding' is not specified, returns data as a buffer.
vfs.stats(path: string): StatusObject
Returns the an instance of StatusObject from a file.
vfs.write(path: string, data?: string|buffer): <VirtualFileSystem>
Writes data to a vfs file, and returns the vfs instance for method chaining.
vfs.append(path: string, data?: string|buffer): <VirtualFileSystem>
Appends data to a vfs file, and returns the vfs instance for method chaining.
vfs.remove(path: string): <VirtualFileSystem>
Removes a file, and returns the vfs instance for method chaining.
vfs.readdir(path: string, [options: object]): array
Options include:
recurse: boolean (default: false)
absolutePaths: boolean (default: true)
withFileTypes: boolean (default: false)
VirtualFileSystem.VDirent object instead of filenamesvfs.listdir(path: string): array
Reads and returns the contents of a directory and subdirectories. (Behaves similar to vfs.readdir with option 'recurse' enabled.
vfs.mkdir(path: string): <VirtualFileSystem>
Creates a directory (filling path gaps) and returns the vfs instance for method chaining.
vfs.rmdir(path: string, [force: boolean]: <VirtualFileSystem>
Removes a directory. To remove a filled directory and its items, 'force' must be enabled.
vfs.copy(path: string, newpath: string): <VirtualFileSystem>
Copies a file instance from one place to another, keeping status.
vfs.move(path: string, newpath: string): <VirtualFileSystem>
Moves a file instance from one place to another, keeping status, UUID, and creation time.
vfs.virtualize('C:\\Users\\someone\\somewhere', '/virtualized')
Takes a real path as rpath and creates a virtualized copy of its contents in vfs under the specified vpath location.
Options include:
recurse: boolean (default: true)
rpath points to a directory, subcontents will be copied.copyctime: boolean (default: false)
vfs.export(file: string, exportType: string('json' | 'pop')): string
Exports a JSON or POP representation of the virtual file system and also returns it.
If file is set to null, the exported version will not be saved, only returned.
The exportType parameter must be one of 'json' or 'pop', and controls the output format.
The 'pop' export format stands for 'filesystem population format', and is a minimal representation of a vfs, containing only filename and contents of entries. While, the 'json' export format includes all data of each file entry, including path, data, uuid, and ctime.
vfs.import(file: string): <VirtualFileSystem>
Imports a previously exported JSON representation of a virtual file system into the current vfs.
Conflicting entries will be overriden by the newly imported version.
This method can only import instances exported with vfs.export in 'JSON' mode.
For importing 'pop' files, see vfs.build documentation.
vfs.build(file: string): <VirtualFileSystem>
Imports a previously exported POP representation of a virtual file system into the current vfs.
Conflicting entries will be overriden by the newly imported version.
This method can only import instances exported with vfs.export in 'POP' mode.
For importing 'JSON' files, see vfs.import documentation.
As 'pop' exports of vfs instances contain minimal information, the ctime and uuid of files is not kept, and will be recreated.
FAQs
A lightweight package for manipulating an in-memory unix-like virtual file systems (vfs).
The npm package vfilesys receives a total of 2 weekly downloads. As such, vfilesys popularity was classified as not popular.
We found that vfilesys 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.