# parse-cloud-function

> Create scalable parse cloud functions

Latest version **1.0.1** (published 2019-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse-cloud-function
pnpm add parse-cloud-function
yarn add parse-cloud-function
bun add parse-cloud-function
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-01-06 |
| First published | 2018-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Abdelrahman Ashraf |
| Maintainers | theashraf |
| Keywords | parse-server, parse, cloud, code, parse-server-cloud |

## Links

- npm: https://www.npmjs.com/package/parse-cloud-function
- Repository: https://github.com/theashraf/parse-cloud-function
- Homepage: https://github.com/theashraf/parse-cloud-function#readme
- Issues: https://github.com/theashraf/parse-cloud-function/issues
- npm.io page: https://npm.io/package/parse-cloud-function

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-01-06
- 1.0.0 — 2018-12-29

## README

# Parse Cloud Function

[![npm](https://img.shields.io/npm/v/parse-cloud-function.svg)](https://www.npmjs.com/package/parse-cloud-function)
[![license](https://img.shields.io/github/license/theashraf/parse-cloud-function.svg)](https://github.com/theashraf/parse-cloud-function/blob/master/LICENSE)
[![npm](https://img.shields.io/npm/dw/parse-cloud-function.svg)](https://www.npmjs.com/package/parse-cloud-function)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](#badge)

> Create scalable parse cloud functions

Parse Cloud Function helps in adding middlewares to cloud functions for more clean,reusable and scalable cloud code

## Installation

```sh
npm install --save parse-cloud-function
```

## Example

A working example can be found [here](example)

### Supported versions

- parse-server >= 3.0.0
- node >= 6.4

### Basic Usage

```js
//parse cloud code file
const CloudFunction = require('parse-cloud-function')
const authMiddleware = async req => {
	if (!req.user) throw 'unauthorized'
	return req // passes the req to the next middleware function
}
const anotherMiddleware = async req => {
	req.data = 'some data'
	return req
}
new CloudFunction(Parse)
	.use([authMiddleware, anotherMiddleware])
	.define('myFunction', async req => {
		console.log(req.data) // 'some data'
		return 'success'
	})
```

## Development setup

```sh
npm install && npm run dev
```

## Contribution

1. Fork the project
2. Create your feature branch (`git checkout -b feature/fooBar`), or hotfix branch (`git checkout -b hotfix/fooBar`)
3. Commit your changes (`npm run cz`)
4. Push to the feature branch (`git push origin feature/fooBar`), or hotfix branch (`git push origin hotfix/fooBar`)
5. Create a new Pull Request

---
_Source: https://npm.io/package/parse-cloud-function · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
