open-index/open-npm huggingface dataset:
npm package: @raincatcher/filestore
Description: RainCatcher file storage server
Author: feedhenry-raincatcher@redhat.com
Latest version: 1.1.2

# RainCatcher FileStore

Server-side [express](https://expressjs.com/) module to support file uploads from the `@raincatcher/filestore-client` module.

## Usage

In order to include this module in an existing express application, use the `createRouter` function and supply an implementation of the `FileStorage` interface.

```typescript
import { createRouter, FileStorage, GridFsStorage } from '@raincatcher/filestore';

//...

const storage: FileStorage = new GridFsStorage(mongoDbConnectionUrl);
expressApp.use('/file', createRouter(storage));
```

## FileStorage Interface

The `FileStorage` is an interface that should be implemented in order to supply an alternative place for file data to be transferred to, based on manipulating [NodeJS Streams](https://nodejs.org/api/stream.html) to allow storage and retrieval of the uploaded binary data.

## Implementations

The [current implementations](./src/impl/) support:

- GridFS (MongoDB's API for storing larger files - GridFsStorage)
- Amazon S3 (S3Storage)
- Local file storage (LocalStorage)

See individual storage implementations for the list of required parameters.
npm package: @raincatcher/filestore-client
Description: RainCatcher file storage client
Author: feedhenry-raincatcher@redhat.com
Latest version: 1.1.2

# RainCatcher FileStore client

RainCatcher FileStore Client provides a manager which provides the support for:

- Downloading files from a server.
- Uploading files from a mobile device to a server.

## Usage
1. Implement the [HttpClient](./src/HttpClient.ts) Interface

2. Import FileManager
```javascript
var FileManager = require('@raincatcher/filestore-client').FileManager;
...
var fileManager = new FileManager(serverUrl, fileQueueName, httpClient);
```

3. Use the FileManager for uploading/downloading files to and from the server.
```javascript
fileManager.scheduleFileToBeUploaded(fileQueueEntry);
fileManager.scheduleFileToBeDownloaded(fileQueueEntry);
```
- Ensure the fileQueueEntry adheres to the [FileQueueEntry](./src/FileQueueEntry.ts) interface.

## HttpClient Interface

The [HttpClient](./src/HttpClient.ts) interface should be implemented in order to enable the FileStore client to make network requests for uploading and downloading files to and from a server.