Skip to content

Commit 22c6bad

Browse files
committed
Added REDME.MD support for cloudinary and nfs
1 parent eee5dda commit 22c6bad

File tree

2 files changed

+57
-6
lines changed

2 files changed

+57
-6
lines changed

README.md

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ objects to users via direct download. Storage Pipe Manager is a Pipe Factory tha
2323
* [Installing the client library](#installing-the-client-library)
2424
* [Using the client library on S3](#using-the-client-library-on-aws)
2525
* [Using the client library Google Storage](#using-the-client-library-on-gcloud)
26-
* [Samples](#samples)
26+
* [Samples](#integration-samples)
2727
* [Versioning](#versioning)
2828
* [Contributing](#contributing)
2929
* [License](#license)
@@ -44,6 +44,11 @@ export AWS_SECRET_ACCESS_KEY=982u289432u48jsdfkjsr3894
4444
export AWS_SESSION_TOKEN (optional)
4545
```
4646

47+
Cloudinary Declaration
48+
```bash
49+
export CLOUDINARY_URL=cloudinary://4737858435783453:3827489jksdhfjasfhjBB@nitrocode
50+
```
51+
4752
Local NFS Declaration
4853
```bash
4954
export MOUNT_POINT=/Users/nitrocode/bucket/
@@ -75,7 +80,7 @@ node_storage_manager allows you to switch between clients easily without reconfi
7580
async function download(bucketName) {
7681
// Creates the new bucket
7782
await StorageInstance.download(bucketName, 'file', 'destination');
78-
console.log(`Bucket ${bucketName} created.`);
83+
console.log(`file downloaded`);
7984
}
8085

8186
```
@@ -96,10 +101,56 @@ node_storage_manager allows you to switch between clients easily without reconfi
96101
async function download(bucketName) {
97102
// Creates the new bucket
98103
await StorageInstance.download(bucketName, 'file', 'destination');
99-
console.log(`Bucket ${bucketName} created.`);
104+
console.log(`file downloaded`);
100105
}
101106

102107
```
108+
109+
### Using the client library on `CLOUDINARY`
110+
```javascript
111+
// Imports the node_storage_manager library
112+
const Storage = require('node_storage_manager');
113+
114+
// Set Storage Instance between AWS,GCLOUD and FS
115+
let StorageInstance = Storage.getInstance('CLOUDINARY');
116+
117+
/**
118+
* TODO(developer): Uncomment these variables before running the sample.
119+
*/
120+
// let bucketName = 'bucket-name';
121+
122+
async function download(bucketName) {
123+
// Creates the new bucket
124+
await StorageInstance.download(bucketName, 'filepath', 'image or video');
125+
console.log(`file downloaded`);
126+
}
127+
```
128+
129+
### Using the client library on `NFS`
130+
```javascript
131+
// Imports the node_storage_manager library
132+
const Storage = require('node_storage_manager');
133+
134+
// Set Storage Instance between AWS,GCLOUD and FS
135+
let StorageInstance = Storage.getInstance('NFS');
136+
137+
/**
138+
* TODO(developer): Uncomment these variables before running the sample.
139+
*/
140+
// let bucketName = 'bucket-name';
141+
142+
async function download(bucketName) {
143+
// Creates the new bucket
144+
await StorageInstance.download(bucketName, 'file to download', 'destination e.g /Users/nitrocode/tmp/');
145+
console.log(`file downloaded`);
146+
}
147+
```
148+
149+
150+
### Integration Samples
151+
Still Updating README.MD file would publish soon
152+
153+
103154
## Versioning
104155

105156
This library follows [Semantic Versioning](http://semver.org/).

test/sdk.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ describe('Simple Storage Test', () => {
66

77
//First stage Unit Test
88
it('should run', () => {
9-
let StorageInstance = storageSystem.getInstance('CLOUDINARY');
10-
const data = StorageInstance.upload('media', '/Users/nitrocode/tmp/up.png', 'image');
11-
console.log(data);
9+
let StorageInstance = storageSystem.getInstance('NFS');
10+
StorageInstance.download('media', 'dev_key.key', '/Users/nitrocode/tmp/');
11+
console.log(StorageInstance);
1212
});
1313

1414
});

0 commit comments

Comments
 (0)