
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
azure-storage-as-promised
Advanced tools
A promise wrapper for Azure Storage. Github repo
You can read about Azure Storage.
If the outermost storage inside the resource, such as a share or container, doesn't exist, it is created as part of the request.
For Blob storage, the base directory is known as an empty string.
npm install azure-storage-as-promised
The tests include usage of objects.
This method signature changed in V 0.9.0.
require('dotenv').config();
const BlobStorage = require("azure-storage-as-promised").Blob;
const myblob = new BlobStorage(process.env.AZURESTORAGECONNECTIONSTRING);
const container="function-blob-upload";
const directory=""; // root dir is empty string
const blob="short.txt";
const finalBlob = directory + '/' + blob;
myblob.getBlobProperties(container, blob).then(results=>{
console.log(JSON.stringify(results));
}).catch(err=>{
console.log(err);
})
// import classes in package
import { File } from 'azure-storage-as-promised';
// set connection string
const fileAzure = new File(process.env.AZURESTORAGECONNECTIONSTRING);
// create directory which creates share
const directoryResult = await fileAzure.createDirectory(share, directory, undefined);
// check that share does exist
const shareResult:any = await fileAzure.doesShareExist(share);
// check that directory does exist
const doesDirectoryExist = await fileAzure.doesDirectoryExist(share, directory);
// add file
const fileResult:any = await fileAzure.addFile(share, directory, fileName, fileFullPath, optionalContentSettings, optionalMetadata);
// get file properties
const fileProperties:any = await fileAzure.getFileProperties(share, directory, fileName);
// get file download
const url:any = await fileAzure.getFileUrl(share, directory, fileName);
// get base directories, empty string is base directory
const directoriesAndFiles:any = await fileAzure.getDirectoriesAndFiles(share, "");
// get subdir files
const subDirectoriesAndFiles:any = await fileAzure.getDirectoriesAndFiles(share, directoriesAndFiles.directories[0].name);
// delete directory and all files within
const deleteDirectoryResults:any = await fileAzure.deleteDirectory(share, directoriesAndFiles.directories[0].name);
// check that directory doesn't exist
const doesDirectoryExist2:any = await fileAzure.doesDirectoryExist(share, directory);
// delete Share
const deleteShareResult:any = await fileAzure.deleteShare(share);
npm run test
Version 0.9.0
Blob.getBlobProperties has new signature - directory is now a part of blob. For example, if directory is 'abc' and blob name is 'xyz', these are passing in as the blob variable, 'xyz/abc'.
FAQs
Wrapper on top of azure-storage with promises.
We found that azure-storage-as-promised 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.