Socket
Socket
Sign inDemoInstall

azurite

Package Overview
Dependencies
70
Maintainers
1
Versions
153
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.1.0

lib/api/DeleteContainer.js

5

lib/api/CreateContainer.js

@@ -19,4 +19,7 @@ 'use strict';

res.status(409).send();
} else {
res.status(500).send();
throw e;
}
})
});
}

@@ -23,0 +26,0 @@ }

3

lib/Azurite.js

@@ -11,3 +11,4 @@ 'use strict';

// Global Bluebird Config
BbPromise.onPossiblyUnhandledRejection(function (err) {
BbPromise.onPossiblyUnhandledRejection((err) => {
console.log('PANIC: Emulator may be in an inconsistent state!');
process.stderr.write(err.stack);

@@ -14,0 +15,0 @@ process.abort();

'use strict';
const createContainerHandler = require('./../api/CreateContainer'),
deleteContainerHandler = require('./../api/DeleteContainer'),
env = require('./../env');

@@ -21,3 +22,8 @@

}
})
.delete((req, res) => {
if (req.query.restype === 'container') {
deleteContainerHandler.process(req, res, req.params.container);
}
});
}

@@ -7,6 +7,4 @@ 'use strict';

Loki = require('lokijs'),
fs = require('fs');
fs = BbPromise.promisifyAll(require("fs-extra"));
BbPromise.promisifyAll(require("fs"));
const CONTAINERS_COL_NAME = 'Containers';

@@ -34,3 +32,3 @@

if (e.code === 'ENOENT') {
// No DB hasn't been persisted initialized yet.
// No DB hasn't been persisted / initialized yet.
this.db.addCollection(CONTAINERS_COL_NAME);

@@ -54,4 +52,18 @@ return this.db.saveDatabaseAsync();

}
deleteContainer(name) {
let container = path.join(env.localStoragePath, name);
return fs.statAsync(container)
.then((stat) => {
return fs.removeAsync(container);
})
.then(() => {
let tables = this.db.getCollection(CONTAINERS_COL_NAME);
tables.chain().find({ 'name': { '$eq': name }}).remove();
// TODO: Delete all blobs stored in the container
return this.db.saveDatabaseAsync();
});
}
}
module.exports = new StorageManager;
{
"name": "azurite",
"version": "0.0.1",
"version": "0.1.0",
"description": "A lightweight server clone of Azure Blob Storage that simulates most of the commands supported by it with minimal dependencies.",

@@ -37,2 +37,3 @@ "scripts": {

"express": "^4.14.0",
"fs-extra": "^1.0.0",
"lokijs": "^1.4.1",

@@ -39,0 +40,0 @@ "minimist": "^1.2.0"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc