
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
azure-storage-fs
Advanced tools
A drop-in "fs" replacement for accessing Azure Storage with Node.js "fs" API
A drop-in "fs" replacement for accessing Azure Storage with Node.js "fs" API.
This package is designed to support ftpd.
azure-storage-fs is designed to replace Node.js "fs" package and integrate with ftpd package.
const fs = require('azure-storage-fs').blob(accountName, secret, container);
fs.readFile('helloworld.txt', (err, data) => {
console.log(err || data);
});
If you want to bring your own BlobService and prefer a Promise interface like mz/fs.
const { createBlobService } = require('azure-storage');
const fs = require('azure-storage-fs').blob(createBlobService(), container).promise;
const data = await fs.readFile('helloworld.txt');
console.log(data);
ftpd supports custom "fs" implementation and azure-storage-fs is designed to be a "fs" provider for ftpd.
To use a custom "fs" implementation, in your ftpd authorization code (command:pass event), add require('azure-storage-fs').blob(accountName, secret, container) to the success callback. For example,
connection.on('command:pass', (password, success, failure) => {
if (auth(username, password)) {
success(username, require('azure-storage-fs').blob(accountName, secret, container));
} else {
failure();
}
});
ftpd will call fs.readdir() first, then fs.stat() for every file
fs.stat() on a directory will result in 2 calls to AzurePaths will be normalized with the following rules:
For example, \Users\Documents\HelloWorld.txt will become Users/Documents/HelloWorld.txt.
Since Blob service is flat natively, it does not support directory tree. It use delimiter / to provides a hierarchical view of its flat structure. A hidden empty blob named $$$.$$$ is used to represent empty directory.
Only block blob is supported and is the default blob type when creating a new blob.
createReadStream
encoding is not supportedsnapshot options for specifying ID of the snapshot to readcreateWriteStream
encoding is not supportedmetadata option to specify blob metadatamkdir
EEXIST if the directory already exists$$$.$$$open
r, w, and wxsnapshot options for specifying ID of the snapshot to openreaddirreadFile
createReadStreamencoding is not supportedsnapshot options for specifying ID of the snapshot to readrename
rmdir
$$$.$$$ if existsENOTEMPTY if notsas(path, options) (New)
flag (optional)
r, a, c, w, dstart (optional)
expiry (optional)
setMetadata(metadata, options) (New)
snapshot (optional)
snapshot(path, options) (New)
snapshot (optional)
stat(path, options)
isDirectory()mode always equals to R_OK | W_OKmtimesize
0 for directoryurl for the actual URL (not support Shared Access Signature yet)metadata (default set to false)
true, the call will also return metadatasnapshot options, the call will also return metadata for snapshotssnapshot (default set to false)
true, the call will also return an array named snapshots, each with the following properties
id is the snapshot IDmtimesizeurlunlink(pathname, options)
snapshot (default set to true)
true will delete all snapshots associated with the blobwriteFile
createWriteStreamencoding is not supportedmetadata option to specify blob metadataSnapshot is supported and snapshot ID can be specified for most read APIs. stat can also set to return snapshot information. By default this is disabled to save transaction cost.
In future, we plan to support Azure Storage File, which is another file storage service accessible thru HTTP interface and SMB on Azure.
BlobServicecontentSettings supportcontentSettings supportcontentSettings supportmetadata supportmetadata supportmetadata supportmetadata supportEEXIST when the directory already existsENOTEMPTY when the directory still contains one or more blobs after deleting $$$.$$$ placeholderexpiry optionflag to r if not setsas() to create a blob SAS token synchronouslysnapshot() to create a blob snapshotrmdir now only delete hidden blob $$$.$$$, instead of delete blobs recursivelyunlink now fail if the blob does not existLike us? Star us.
Doesn't work as expected? File us an issue with minimal code for bug repro.
FAQs
A drop-in "fs" replacement for accessing Azure Storage with Node.js "fs" API
We found that azure-storage-fs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.