Skip to content

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

Notifications You must be signed in to change notification settings

igocreate/node-ovh-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-ovh-storage

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

Install via npm

npm install node-ovh-storage

API Usage

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

const config      = {
  authURL:    'https://auth.cloud.ovh.net/v3',
  username:   'username',
  password:   'password',
  tenantId:   'tenantId',
  region:     'GRA'
};

// test function
const test = async () => {

  const storage = new OVHStorage(config);

  // init token (optional)
  await storage.getToken();

  // create new container
  await storage.createContainer('Container-1');

  // put file
  await storage.putFile('./tmp/doc.pdf', '/Container-1/doc.pdf');

  // list files in container
  await storage.getFileList('/Container-1');

  // get file
  await storage.getFile('/Container-1/doc.pdf');

  // delete file
  await storage.deleteFile('/Container-1/doc.pdf');

};

test();

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published