1.7.0 • Published 7 months ago

ovh-es v1.7.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 months ago

This is an es7 async/await openstack swift client API.

NPM Version Build Status Coverage Status

// Create your first application tokens here: https://api.ovh.com/createToken/?GET=/me
var ovh = require('ovh-es')({
  appKey: process.env.APP_KEY,
  appSecret: process.env.APP_SECRET,
  consumerKey: process.env.CONSUMER_KEY
});

var me = await ovh.request('GET', '/me');
console.log(err || 'Welcome ' + me.firstname);

Installation

$ npm install ovh-es

Services (wrapper)

object-store

"use strict";

const fs = require('fs');
const Context = require('ovh-es/context');
const storage = require('ovh-es/services/object-store');
const pipe = require('nyks/stream/pipe');
const config = require('./credentials');


class foo {
  async run(){
    // init token
    var ctx = await Context.build(config);

    var files = await storage.toggleMode(ctx, 'mediaprivate', ".r:*,.rlistings");
    var headers = await storage.showContainer(ctx, 'mediaprivate');


    var remote = await storage.putFile(ctx, 'boucs.jpg', 'mediaprivate/bouc.jpg');
    var local = fs.createWriteStream('tmp.jpg');

    var remote = storage.download(ctx, 'mediaprivate/bouc.jpg');

    await pipe(remote, local);

    var remote = await storage.deleteFile(ctx, 'mediaprivate/bouc.jpg');

    var files = await storage.getFileList(ctx, 'mediaprivate');
    console.log({files, remote});
  }
}


module.exports = foo;
1.7.0

7 months ago

1.6.2

6 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.2

6 years ago

1.3.0

6 years ago

1.2.2

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago