Coder Social home page Coder Social logo

node_azure_blob_storage_promise's Introduction

node_azure_blob_storage

Simple example of using Azure blob Storage with node.js and testing CRUD operations with Mocha framework. This is a rewrite of node_azure_blob_storage using promise with bluebird module The output should look similar to this:

Azure Blob Storage Test
    Creating Azure blob Service 
      ✓ Blob service should not be null
      Creating Azure container:57711d6b9d
        ✓ Container creation should succeed (1246ms)
        CRUD Blob storage
          Listing blobs
            ✓ should return no entries (690ms)
          Uploading file
            ✓ should succeed (591ms)
          Listing blobs
            ✓ should return one entry (574ms)
          Downloading existing blob
            ✓ should succeed (1140ms)
          Deleting existing blob
            ✓ should succeed (559ms)
          Listing blobs
            ✓ should return no entries (553ms)
      Deleting container:57711d6b9d
        ✓ Deletion should succeed (1132ms)

Requirements

  • nodejs >= 4.3.1
  • npm 1.4.21

Usage

In order to run the script, just execute npm test

user@home:~/projects/node_azure_blob_storage$npm install
user@home:~/projects/node_azure_blob_storage$npm test

Both Azure storage access key and storage account have to be defined either by setting environment variables or by editing the configuration file (config.json)

Environment variables

export AZURE_STORAGE_ACCESS_KEY=MYKEYLZ/PyfMDDl0psML2uyVfDs6MTsbkb7uWD9HKFiZfJ1pi2nCT0YQQZ94SMBTmbk09kl78MoTvDez6QO4A==
export AZURE_STORAGE_ACCOUNT=mystorage

Configuration file

Edit config/config.json and set both AZURE_STORAGE_ACCESS_KEY and AZURE_STORAGE_ACCOUNT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.