storage-selectel
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

storage-selectel npm version

import StorageSelectel from 'storage-selectel'

const storage = new StorageSelectel({
  user: process.env.USER,
  password: process.env.PASSWORD,
  container: 'master'
})


// upload to main container folder
storage.uploadFile({
  path: 'photo.png'
  body: fs.createReadStream('photo.png')
})

// upload to the folder in container
storage.uploadFile({
  path: 'folder/photo.png'
  body: fs.createReadStream('photo.png')
})

// upload to the subfolder in container
storage.uploadFile({
  path: 'folder/subfolder/photo.png'
  body: fs.createReadStream('photo.png')
})

// upload to the folder in specific container 
storage.uploadFile({
  container: 'slave',
  path: 'photo.png',
  body: fs.createReadStream('photo.png')
})

// get all files in container
storage.getContainerFiles()

// get all files in the folder container
storage.getContainerFiles({
  path: 'folder'
})

// get all files in the subfolder container
storage.getContainerFiles({
  path: 'folder/subfolder'
})

// get all files in the specific container
storage.getContainerFiles({
  container: 'slave'
})

Package Sidebar

Install

npm i storage-selectel

Weekly Downloads

4

Version

0.1.2

License

none

Unpacked Size

18.9 kB

Total Files

15

Last publish

Collaborators

  • murka