1.0.1 • Published 6 years ago

node-selectel-manager v1.0.1

Weekly downloads
36
License
-
Repository
github
Last release
6 years ago

node-selectel-manager

The library provides API for some Selectel storage options. Supported functions:

  • Get container files;
  • Delete file;
  • Upload file;
  • Create container;

Installation

npm install node-selectel-manager

Usage

const fs = require('fs');
const manager = require('./index')({
	login: 'xxx',
	password: 'xxx'
});

const file = fs.readFileSync('/home/user/Downloads/archive.tar.gz');

manager
	.createContainer('test', {'X-Container-Meta-Type': 'public'})
	.then(() => {
		return manager.uploadFile(file, 'test/sub-folder/', 'tar.gz');
	})
	.then(() => {
		return manager.clearCache(['http://xxx.selcdn.com/test/cached-file.jpg']);
	})
	.then(() => {
		return manager.getContainerFiles('test');
	})
	.then(res => console.log(res.body, res.headers)).catch(console.log)

License

MIT

1.0.1

6 years ago

1.0.0

7 years ago

0.0.11

7 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago