Skip to content

skarbovskiy/selectel-manager

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

High-level API for Selectel file storage.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%