/node-ovh-storage

A simple Node.js library to connect to the Object Storage OVH service

Primary LanguageJavaScript

node-ovh-storage

A simple Node.js library to connect to the Object Storage OVH service

Install via npm

npm install node-ovh-storage --save

API Usage

var OVHStorage = require('node-ovh-storage');

var config = {
  username: 'username',
  password: 'password',
  authURL:  'https://auth.cloud.ovh.net/v2.0',
  tenantId: 'tenantId',
  region:   'GRA1'
};

var storage = new OVHStorage(config);
// init token
storage.getToken(function(err) {
  // create new container
  storage.createContainer('Storage-1', function() {
    // put file
    storage.putFile('./tmp/doc.pdf', '/Storage-1/doc.pdf', function(err, res) {
      // list files in container
      storage.getFiles('/Storage-1', function(err, files) {
        // done
      });
    });
  });
});