Adobe I/O CNA Storage SDK
A JavaScript abstraction on top of cloud blob storages exposing a file-system like API.
You can initialize the SDK with your Adobe I/O Runtime (a.k.a OpenWhisk) credentials.
Alternatively, you can bring your own cloud storage keys. Note however, that as of now we only support Azure Blob Storage. AWS S3 is the next on the todo list and will soon be available.
Install
npm install @adobe/adobeio-cna-cloud-storage
Use
const storageSDK = // init // init sdk using OpenWhisk credentials const storage = await storageSDK // init when env vars __OW_AUTH and __OW_NAMESPACE are set (e.g. when running in an OpenWhisk action) const storage = await storageSDK // or if you want to use your own storage account const storage = await storageSDK // write private file await storage // write publicly accessible file await storage // get file url const props = await storage propsurl // list all files await storage // ['mydir/myfile.txt', 'public/index.html'] // read const buffer = await storage buffer // 'some private content' // pipe read stream to local file const rdStream = await storage const stream = rdStream stream // write read stream to remote file const rdStream = fs await storage // delete files in 'my/remote/' dir await storage // delete all public files await storage // delete all files including public await storage // copy // upload local directory await storage // download to local directory await storage // copy files around cloud storage await storage
Explore
goto
API
Contributing
Contributions are welcomed! Read the Contributing Guide for more information.
Licensing
This project is licensed under the Apache V2 License. See LICENSE for more information.