1.0.0 • Published 7 months ago
node-ovh-storage v1.0.0
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
var OVHStorage = require('node-ovh-storage');
var config = {
authURL: 'https://auth.cloud.ovh.net/v3',
username: 'username',
password: 'password',
tenantId: 'tenantId',
region: 'GRA'
};
const storage = new OVHStorage(config);
// init token
storage.getToken((err) => {
// create new container
storage.createContainer('Container-1', () => {
// put file
storage.putFile('./tmp/doc.pdf', '/Container-1/doc.pdf', (err, res) => {
// list files in container
storage.getFileList('/Container-1', (err, files) => {
// read file
storage.getFile('/Container-1/doc.pdf', (err, file) => {
});
});
});
});
});