# facebook-api-video-upload

> A handy function to upload video in chunk on the facebook graph.

Latest version **2.0.1** (published 2019-03-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install facebook-api-video-upload
pnpm add facebook-api-video-upload
yarn add facebook-api-video-upload
bun add facebook-api-video-upload
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2019-03-08 |
| First published | 2016-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 57 |
| Author | mrdotb |
| Maintainers | mrdotb |
| Keywords | stream, facebook-api, facebook, graph, api, upload, video |

## Links

- npm: https://www.npmjs.com/package/facebook-api-video-upload
- Repository: https://github.com/MRdotB/facebook-api-video-upload
- Homepage: https://github.com/MRdotB/facebook-api-video-upload#readme
- Issues: https://github.com/MRdotB/facebook-api-video-upload/issues
- npm.io page: https://npm.io/package/facebook-api-video-upload

## Dependencies (2)

- [request-promise](https://npm.io/package/request-promise.md) ^3.0.0
- [stream-to-promise](https://npm.io/package/stream-to-promise.md) ^2.1.1

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2019-03-08
- 2.0.0 — 2019-03-06
- 1.4.1 — 2019-03-06
- 1.4.0 — 2018-03-20
- 1.3.2 — 2017-09-23
- 1.2.2 — 2016-12-09
- 1.2.1 — 2016-12-09
- 1.2.0 — 2016-12-09
- 1.1.1 — 2016-07-01
- 1.1.0 — 2016-06-11
- 1.0.0 — 2016-06-06

## README

# facebook-api-video-upload
> Upload a video in chunk on the facebook api. [more info](https://developers.facebook.com/docs/graph-api/video-uploads)

## Install
```
$ npm i facebook-api-video-upload --save
```
Tested on OS X and Linux.

## Usage
```javascript
const fs = require('fs');
const fbUpload = require('facebook-api-video-upload');

const args = {
  token: "YOURTOKEN", // with the permission to upload
  id: "YOURID", //The id represent {page_id || user_id || event_id || group_id}
  stream: fs.createReadStream('./fixture.mp4'), //path to the video,
  title: "my video",
  description: "my description",
  thumb: {
    value: fs.createReadStream('./fixture.jpg'),
    options: {
      filename: 'fixture.jpg',
      contentType: 'image/jpg'
    }
  }
  // if you want the default thumb from the video just remove the field
  // you can add any extra fields from the api https://developers.facebook.com/docs/graph-api/reference/page/videos/#Creating
  // all keys except token, id, stream are passed to the final request
};

fbUpload(args).then((res) => {
  console.log('res: ', res);
  //res:  { success: true, video_id: '1838312909759132' }
}).catch((e) => {
  console.error(e);
});```

## License
MIT © [MrdotB](https://github.com/MRdotB)

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