# pronto-documents-service

> Interface for uploading files from a url or a local file path.

Latest version **0.0.5** (published 2019-08-13) · 0 weekly downloads

## Install

```sh
npm install pronto-documents-service
pnpm add pronto-documents-service
yarn add pronto-documents-service
bun add pronto-documents-service
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2019-08-13 |
| First published | 2018-03-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| Author | Prontotype |
| Maintainers | brynwaldwick, chadlieberman, spro |

## Links

- npm: https://www.npmjs.com/package/pronto-documents-service
- Repository: https://github.com/prontotype-us/pronto-documents-service
- Homepage: https://github.com/prontotype-us/pronto-documents-service#readme
- Issues: https://github.com/prontotype-us/pronto-documents-service/issues
- npm.io page: https://npm.io/package/pronto-documents-service

## Dependencies (4)

- [async](https://npm.io/package/async.md) ^2.1.4
- [aws-sdk](https://npm.io/package/aws-sdk.md) 2.1.x
- [request](https://npm.io/package/request.md) 2.67.x
- [file-type](https://npm.io/package/file-type.md) ^4.1.0

## Recent versions

- 0.0.5 (latest) — 2019-08-13
- 0.0.4 — 2018-09-07
- 0.0.3 — 2018-06-19
- 0.0.2 — 2018-04-13
- 0.0.1 — 2018-03-05

## README

# Documents Service

Interface for uploading files from a url or a local file path.

## Configuration

Configure the service with a provider and the configuration for that provider's node api. For now just use s3.

    provider: 's3'
    s3: {
        accessKeyId: ''
        secretAccessKey: ''
        region: ''
    }


If you wanted, you could spin up two separate documents services (with different slugs) that host images on separate providers... and use them to host bulk public & secure images from your platform in different places according to any requirements. You can also just do this with different s3 buckets from different apps.

## Methods

#### `uploadFileFromURL = (bucket, url, dest_filename, cb) ->`

Upload to a bucket from a url. The file will be saved at `s3:[bucket]/dest/filename/here.png`

#### `uploadFileFromPath = (bucket, path, dest_filename, cb) ->`

Upload to a bucket from a local path on your server. The file will be saved at `s3:[bucket]/dest/filename/here.png`

#### `deleteDocument = (bucket, full_filename, cb) ->`

Remove a file from a bucket with an s3 path from that bucket.

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