
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@flystorage/file-storage
Advanced tools
Flystorage is a file storage abstraction for NodeJS and TypeScript. It is an 80/20 solution that is built around a set of goals:
Flystorage is meant to be used in cases for generic file storage use-cases. It's not an API for any specific filesystem. It's a generalised solution and will not implement feature only specific to one particular storage implementation. There will be use-cases that are not catered to, simply because they cannot be abstracted over in a reasonable manner.
basic-ftp
)Install the main package and any adapters you might need:
npm i -S @flystorage/file-storage
# for using AWS S3
npm i -S @flystorage/aws-s3
# for using the local filesystem
npm i -S @flystorage/local-fs
import {resolve} from 'node:path';
import {createReadStream} from 'node:fs';
import {FileStorage, Visibility} from '@flystorage/file-storage';
import {LocalStorageAdapter} from '@flystorage/local-fs';
/**
* SETUP
**/
const rootDirectory = resolve(process.cwd(), 'my-files');
const storage = new FileStorage(new LocalStorageAdapter(rootDirectory));
/**
* USAGE
**/
// Write using a string
await storage.write('write-from-a-string.txt', 'file contents');
// Write using a stream
const stream = createReadStream(resolve(process.cwd(), 'test-files/picture.png'));
await storage.write('picture.png', stream);
// Write with visibility (permissions).
await storage.write('public.txt', 'debug', {
visibility: Visibility.PUBLIC, // mode: 0o644
});
await storage.write('private.txt', 'debug', {
visibility: Visibility.PRIVATE, // mode: 0o600
});
// List directory contents
const contentsAsAsyncGenerator = storage.list('', {deep: true});
for await (const item of contentsAsAsyncGenerator) {
console.log(item.path);
if (item.isFile) {
// do something with the file
} else if (item.isDirectory) {
// do something with the directory
}
}
// Delete a file
await storage.deleteFile('some-file.txt');
// Delete a directory (with all contents)
await storage.deleteDirectory('some-directory');
Flystorage is built by the maintainer of Flysystem, a filesystem abstraction for PHP. This brings along over a decade of filesystem abstraction experience.
FAQs
File-storage abstraction: multiple filesystems, one API.
The npm package @flystorage/file-storage receives a total of 7,442 weekly downloads. As such, @flystorage/file-storage popularity was classified as popular.
We found that @flystorage/file-storage demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.