node Stack client
This is a node.js client for TransIP Stack cloud storage
Installation
$ npm install --save stack-client
Example
const fs = ;const zlib = ; const StackClient = ; const client = 'https://example.stackstorage.com' 'user' 'pass'; const outputStream = client const inputStream = fs; const gzip = zlib; gzipinputStream
API
Instantiating
Instantiate the stack client by passing the base URL of your Stack, the username, the password:
const StackClient = ; const client = 'https://example.stackstorage.com' 'user' 'pass';
Writing files
Use createWriteStream(path, [cb]) to create a writiable stream into a file under specified path:
const fs = ;const zlib = ; ... const outputStream = clientconst inputStream = fs; const gzip = zlib; gzipinputStream
Creating folders
Use mkdir(path) to create a folder within your Stack:
await clientawait client
Removing files and folders
Use delete(path) to remove files and folders:
await clientawait client
License
Licensed under MIT License. Copyright (C) 2019 Coldrift Technologies B.V. All rights reserved.