Skip to content

Commit

Permalink
Added REDME.MD support for cloudinary and nfs
Browse files Browse the repository at this point in the history
  • Loading branch information
9trocode committed Feb 26, 2020
1 parent eee5dda commit 22c6bad
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 6 deletions.
57 changes: 54 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ objects to users via direct download. Storage Pipe Manager is a Pipe Factory tha
* [Installing the client library](#installing-the-client-library)
* [Using the client library on S3](#using-the-client-library-on-aws)
* [Using the client library Google Storage](#using-the-client-library-on-gcloud)
* [Samples](#samples)
* [Samples](#integration-samples)
* [Versioning](#versioning)
* [Contributing](#contributing)
* [License](#license)
Expand All @@ -44,6 +44,11 @@ export AWS_SECRET_ACCESS_KEY=982u289432u48jsdfkjsr3894
export AWS_SESSION_TOKEN (optional)
```

Cloudinary Declaration
```bash
export CLOUDINARY_URL=cloudinary://4737858435783453:3827489jksdhfjasfhjBB@nitrocode
```

Local NFS Declaration
```bash
export MOUNT_POINT=/Users/nitrocode/bucket/
Expand Down Expand Up @@ -75,7 +80,7 @@ node_storage_manager allows you to switch between clients easily without reconfi
async function download(bucketName) {
// Creates the new bucket
await StorageInstance.download(bucketName, 'file', 'destination');
console.log(`Bucket ${bucketName} created.`);
console.log(`file downloaded`);
}

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

```

### Using the client library on `CLOUDINARY`
```javascript
// Imports the node_storage_manager library
const Storage = require('node_storage_manager');

// Set Storage Instance between AWS,GCLOUD and FS
let StorageInstance = Storage.getInstance('CLOUDINARY');

/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// let bucketName = 'bucket-name';

async function download(bucketName) {
// Creates the new bucket
await StorageInstance.download(bucketName, 'filepath', 'image or video');
console.log(`file downloaded`);
}
```

### Using the client library on `NFS`
```javascript
// Imports the node_storage_manager library
const Storage = require('node_storage_manager');

// Set Storage Instance between AWS,GCLOUD and FS
let StorageInstance = Storage.getInstance('NFS');

/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// let bucketName = 'bucket-name';

async function download(bucketName) {
// Creates the new bucket
await StorageInstance.download(bucketName, 'file to download', 'destination e.g /Users/nitrocode/tmp/');
console.log(`file downloaded`);
}
```


### Integration Samples
Still Updating README.MD file would publish soon


## Versioning

This library follows [Semantic Versioning](http://semver.org/).
Expand Down
6 changes: 3 additions & 3 deletions test/sdk.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ describe('Simple Storage Test', () => {

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

});

0 comments on commit 22c6bad

Please sign in to comment.