# pointyapi-cloudinary

> [Stateless Studio: Web-App Developers](https://stateless.studio)

Latest version **0.0.7** (published 2020-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install pointyapi-cloudinary
pnpm add pointyapi-cloudinary
yarn add pointyapi-cloudinary
bun add pointyapi-cloudinary
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2020-10-22 |
| First published | 2019-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | stateless-studio |
| Maintainers | stateless-studio |

## Links

- npm: https://www.npmjs.com/package/pointyapi-cloudinary
- npm.io page: https://npm.io/package/pointyapi-cloudinary

## Dependencies (1)

- [cloudinary](https://npm.io/package/cloudinary.md) ^1.17.0

## Recent versions

- 0.0.7 (latest) — 2020-10-22
- 0.0.6 — 2019-11-14
- 0.0.5 — 2019-08-26
- 0.0.4 — 2019-07-15
- 0.0.3 — 2019-07-14
- 0.0.2 — 2019-06-23
- 0.0.1 — 2019-06-20

## README

# PointyAPI Cloudinary

[Stateless Studio: Web-App Developers](https://stateless.studio)

## Install
`npm i pointyapi-cloudinary`

## Use

```typescript
import { cloud } from 'pointyapi-cloudinary';

pointy.before = (app) => {
	...

	// Initialize Cloudinary
	cloud.init();

	...
}

...

// Usage is very simple if the thumbnail members are named 'thumbnail'
router.patch('/', onlySelf, cloud.updateThumbnail, patchEndpoint);
router.delete('/', onlySelf, cloud.deleteThumbnail, deleteEndpoint);

// Otherwise, pass an argument to specify custom thumbnail member names
router.patch(
	'/',
	onlySelf,
	(req, res, next) =>
		cloud.updateThumbnail(req, res, next, 'customThumbnail'),
	patchEndpoint
);
router.delete(
	'/',
	onlySelf,
	(req, res, next) =>
		cloud.deleteThumbnail(req, res, next, 'customThumbnail'),
	deleteEndpoint
);

```

### Some images should not be deleted...

Sometimes, you don't want an image to be delete when it is updated or the object is removed.
For example, if you have a default thumbnail for all users, it shouldn't be deleted when a user uploads their own.

`cloud.undeletables` is an array of IDs you don't want to be deleted:

```typescript
...
cloud.init();

cloud.undeletables = [ process.env.DEFAULT_THUMBNAIL ];
```

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