compulim / azure-storage-fs Goto Github PK
View Code? Open in Web Editor NEWA drop-in "fs" replacement for accessing Azure Storage with Node.js "fs" API
License: MIT License
A drop-in "fs" replacement for accessing Azure Storage with Node.js "fs" API
License: MIT License
๐ Everyone can see build progress
๐ No code coverage report, and poor test result visualization
Faster tests
I am using azure-storage-fs as the filing system for my ftpd implementation. I can connect to the azure storage, upload a file and read the directory when empty, however when a file exists in the container I get the following error when getting the directory listing via fileZilla:
TypeError: unexpected "file type"
at Mode.toString (/usr/src/app/node_modules/stat-mode/index.js:91:11)
at whenReady (/usr/src/app/node_modules/ftpd/lib/FtpConnection.js:612:57)
at FtpConnection._whenDataReady (/usr/src/app/node_modules/ftpd/lib/FtpConnection.js:155:7)
at /usr/src/app/node_modules/ftpd/lib/FtpConnection.js:579:12
at afterWrite (_stream_writable.js:464:3)
at _combinedTickCallback (internal/process/next_tick.js:144:20)
at process._tickCallback (internal/process/next_tick.js:180:9)
My connection code is:
if (pass) {
success(username, require('azure-storage-fs').blob(
blobAccountName,
blobSecret,
containerName));
// success(username);
} else {
failure();
}
});
Looking at stat-mode, it can't determine the type of the file (ie. isDirectory(), etc) and falling through to this exception.
The container I am testing has 1 file and is a block blob type and I have attempted this with classic storage, storage v1 and storage v2.
Any help would be greatly appreciated
My dependancies are
"dependencies": {
"async": "^2.6.0",
"azure-storage": "^2.8.1",
"azure-storage-fs": "^0.4.0",
"bluebird": "^3.4.1",
"debug": "^2.2.0",
"deep-assign": "^2.0.0",
"ftpd": "nodeftpd/nodeftpd",
"dateformat": "1.0.7-1.2.3",
"stat-mode": "^0.2.2"
},
At https://github.com/compulim/azure-storage-fs/blob/master/lib/AzureBlobFS.js#L15, promisifyhelper
should be case sensitive.
Cannot find module './util/promisifyhelper' from 'AzureBlobFS.js'
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:191:17)
at Object.<anonymous> (node_modules/azure-storage-fs/lib/AzureBlobFS.js:11:37)
listBlobsSegmentedWithPrefix
is nice, we should add prefix
to options
in readdir
.
https://github.com/compulim/azure-storage-fs/blob/master/lib/AzureBlobFS.js#L57
Instead of accepting strictly BlobService
, accept likeys. Maybe createContainer
is a good check, or list what we need.
lib
should be src
.package.json
should whitelist files
As Promise is now on ES6, we no longer need bluebird
.
Currently, showing quirkiness of API as a way to list our APIs is kind of bad.
Everything is working fine when running it locally.
When I deployed this to an Azure VM the server hangs when listing the directory.
Remove doWhilst
and whilst
, replace with async
/await
.
Usage:
const azureStorage = require('azure-storage');
const blobService = azureStorage.createBlobService();
require('azure-storage-fs').blob(blobService);
const fs = require('azure-storage-fs').file();
fs.readFile('textfile.txt', 'utf8', (err, content) => {
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.