open-index/open-npm huggingface dataset:
npm package: @gersur/nest-file-fastify
Description: fastify-multipart decorators for Nest.js
Latest version: 1.0.0

<div align="left">
  <h1> fastify-multipart for Nest.js</h1>

[![Github Actions](https://img.shields.io/github/workflow/status/blazity/nest-file-fastify/Build?style=flat-square)](https://github.com/Blazity/nest-file-fastify)
[![NPM](https://img.shields.io/npm/v/@blazity/nest-file-fastify.svg?style=flat-square)](https://www.npmjs.com/package/@blazity/nest-file-fastify)
[![NPM](https://img.shields.io/npm/dm/@blazity/nest-file-fastify?style=flat-square)](https://www.npmjs.com/package/@blazity/nest-file-fastify)

</div>

This library adds decorators for [Nest.js](https://github.com/nestjs/nest) to support [@fastify/multipart](https://github.com/fastify/fastify-multipart). The API is very similar to the official Nest.js Express file decorators.

## Installation

NPM

```bash
$ npm install @blazity/nest-file-fastify @fastify/multipart
```

Yarn

```bash
$ yarn add @blazity/nest-file-fastify @fastify/multipart
```

and register multpart plugin in your Nest.js application

```typescript
import fastyfyMultipart from '@fastify/multipart';

...

app.register(fastyfyMultipart);
```

## Docs

### Single file

```ts
import { FileInterceptor, UploadedFile, MemoryStorageFile } from '@blazity/nest-file-fastify';

@Post('upload')
@UseInterceptors(FileInterceptor('file'))
uploadFile(@UploadedFile() file: MemoryStorageFile) {
  console.log(file);
}
```

`FileInterceptor` arguments:

- `fieldname`: string - name of the field that holds a file

- `options`: optional object of type [`UploadOptions`](src/multipart/options.ts#L4)

### Array of files

```ts
import { FilesInterceptor, UploadedFiles, MemoryStorageFile } from '@blazity/nest-file-fastify';

@Post('upload')
@UseInterceptors(FilesInterceptor('files'))
uploadFile(@UploadedFiles() files: MemoryStorageFile[]) {
  console.log(files);
}
```

`FilesInterceptor` arguments:

- `fieldname`: string - name of the field that holds files

- `maxCount`: optional number - maximum number of files to accept

- `options`: optional object of type [`UploadOptions`](src/multipart/options.ts#L4)

### Multiple files

```ts
import { FileFieldsInterceptor, UploadedFiles, MemoryStorageFile } from '@blazity/nest-file-fastify';

@Post('upload')
@UseInterceptors(FileFieldsInterceptor([
  { name: 'avatar', maxCount: 1 },
  { name: 'background', maxCount: 1 },
]))
uploadFile(@UploadedFiles() files: { avatar?: MemoryStorageFile[], background?: MemoryStorageFile[] }) {
  console.log(files);
}
```

`FileFieldsInterceptor` arguments:

- `uploadFields`: object of type [`UploadField`](src/multipart/handlers/file-fields.ts#L10)

- `options`: optional object of type [`UploadOptions`](src/multipart/options.ts#L4)

### Any files

```ts
import { AnyFilesInterceptor, UploadedFiles, MemoryStorageFile } from '@blazity/nest-file-fastify';

@Post('upload')
@UseInterceptors(AnyFilesInterceptor()
uploadFile(@UploadedFiles() files: MemoryStorageFile[]) {
  console.log(files);
}
```

`AnyFilesInterceptor` arguments:

- `options`: optional object of type [`UploadOptions`](src/multipart/options.ts#L4)
npm package: @gertt/cypher-clone
Description: Clone a Neo4j database using only Cypher queries
Author: Gert Sallaerts
Latest version: 2.1.0

# cypher-clone

Clone a Neo4j database using Cypher queries.

Not recommended for important tasks like backups because:

- Performance probably sucks
- Could explode if new node are added to source database while syncing
- ...

Usefull if you don't have access to your remote Neo4j instance's backups or are not able to connect using `neo4j-admin`.

## Usage

```
npm install --save @gertt/cypher-clone
```

CLI tool:

```
cypher-clone bolt://source.database:7687 bolt://localhost:7687
```

In code:

```js
const sync = require('@gertt/cypher-clone');

sync(
    'bolt://source.database:7687',
    'bolt://localhost:7687'
).catch(err => console.log(err));
```
npm package: @gertt/eslint-diff
Description: Run eslint only on files present in a diff set
Author: Gert Sallaerts
Latest version: 1.0.0

# eslint-diff

Run eslint only on files present in a diff set

## Install

Wraps around the eslint in your project so make sure to have `eslint` installed as well.

```
npm install eslint @gertsallaerts/eslint-diff
```

## Usage

Instead of executing `eslint`, you can run `eslint-diff` with all the same arguments. There is one extra `git` option besides the options supported by `eslint`.

The `git` option lets you specify the commit against which the working directory is compared to generate a list of changes. It defaults to `HEAD`.

If you pass any files, dirs or glob patterns to eslint, changes that are not included in those arguments will not be linted either.

```
# Simply lint all new and changed files since the last commit in your current branch
eslint-diff

# Lint againt changes between master and your working directory
eslint-diff --git master

# Lint againt changes between a specific commit and your working directory
eslint-diff --git 77c1c1f28437c25cf4370fa9cda344930152972e

# Lint against changes in the src folder
eslint-diff src

# You can pass regular eslint options as well
eslint-diff src --fix
```
npm package: @gertt/ws-transform-stream
Description: Node.JS websocket Transform stream implementation
Author: Gert Sallaerts
Latest version: 0.0.0

# ws-transform-stream

A transformer for websocket streams.

## Usage

```sh
npm install --save @gertsallaerts/ws-transform-stream
```

In your code:

```js
const WsTransformStream = require('@gertt/ws-transform-stream');

/**
 * Make all WS messages uppercase
 */
function transform(message) {
    return message.toUpperCase();
}

const transformer = new WsTransformStream({ transform });

// You'd typically get these when receiving a request on a webserver and needing
// to forward/proxy the WS elsewhere;
const clientWsSocket = ...;
const upstreamWsSocket = ...;

// pipe the sockets through the transformer to transform any messages going from
// client to upstream server
clientWsSocket.pipe(transformer).pipe(upstreamWsSocket);
```