open-index/open-npm huggingface dataset:
npm package: @filestore/disk
Description: Store and retreive files to disk.
Latest version: 0.1.1

# FileStore - Disk

Store and retreive files to disk.

## Installation

```sh
npm install --save @filestore/disk
```

## Usage

```js
const Disk = require('@filestore/disk')
const fs = require('fs')

const filestore = new Disk({ path: 'uploads' })
const file = fs.createReadStream('my-file.txt')

filestore.put('my-file.txt', file).then(() => {
  // "my-file.txt" is now copied to the directory "uploads"
})
```

## API

The API is meant to be interchangeable with any other `@filestore/...` module.

### `new Disk(options)`

+ `options.path` - Path to the directory to store files in
+ `options.prefix` - Prefix that will be prepended to each filename (e.g. `"disk-"`)

Instantiates a new Disk FileStore class.

### `.put(id: string, data: Input[, options: object]) => Promise<void>`

Save a file to disk.

`data` can be a `ReadableStream`, `Buffer`, `string`, `Iterable<Buffer|string>` or `Promise`.

### `.get(id: string) => ReadableStream`

Fetch a file from disk.

### `.has(id: string) => Promise<boolean>`

Check if a file exists on disk.
npm package: @filestore/memory
Description: Store and retreive files in memory.
Latest version: 0.1.0

# FileStore - Memory

Store and retreive files in memory.

## Installation

```sh
npm install --save @filestore/memory
```

## Usage

```js
const Memory = require('@filestore/memory')
const fs = require('fs')

const filestore = new Memory()
const file = fs.createReadStream('my-file.txt')

filestore.put('my-file.txt', file).then(() => {
  // "my-file.txt" is now stored in memory
})
```

## API

The API is meant to be interchangeable with any other `@filestore/...` module.

### `new Memory([options])`

Instantiates a new Memory FileStore class.

(as of now, no options exists)

### `.put(id: string, data: Input[, options: object]) => Promise<void>`

Save a file in memory.

`data` can be a `ReadableStream`, `Buffer`, `string`, `Iterable<Buffer|string>` or `Promise`.

### `.get(id: string) => ReadableStream`

Fetch a file from memory.

### `.has(id: string) => Promise<boolean>`

Check if a file exists in memory.
npm package: @filestore/s3
Description: Store and retreive files on S3.
Latest version: 0.1.0

# FileStore - S3

Store and retreive files on S3.

## Installation

```sh
npm install --save @filestore/s3
```

## Usage

```js
const S3 = require('@filestore/s3')
const fs = require('fs')

const filestore = new S3({ bucket: 'my-files' })
const file = fs.createReadStream('my-file.txt')

filestore.put('my-file.txt', file).then(() => {
  // "my-file.txt" is now uploaded to the S3 bucket "my-files"
})
```

## API

The API is meant to be interchangeable with any other `@filestore/...` module.

### `new S3(options)`

+ `options.bucket` - Name of the bucket to store files in
+ `options.prefix` - Prefix that will be prepended to each key in S3 (e.g. `"files/"`)

Instantiates a new S3 FileStore class.

### `.put(id: string, data: Input[, options: object]) => Promise<void>`

Upload a file to S3.

`data` can be a `ReadableStream`, `Buffer`, `string`, `Iterable<Buffer|string>` or `Promise`.

### `.get(id: string) => ReadableStream`

Fetch a file from S3.

### `.has(id: string) => Promise<boolean>`

Check if a file exists on S3.