mediaflow

0.1.1 • Public • Published

Mediaflow.js

Build Status

Mediaflow Node + Browser JavaScript implementation

Usage

var Mediaflow = require('mediaflow')
var mf = new Mediaflow('my.mediaflow.host.com')
mf.auth(username, apiKey) // Optional
 
mf.search('foobar').then(function(data) {
    console.log('Got', data.total, 'search results', data.media)
})
 
// Upload media in Node.js
// Requires `auth` to be called prior
// When passing a readstream you also need to specify
// a name of your file!
var options = {
    name: 'image.jpg',
    tags: ['foo', 'bar']
}
mf.upload(fs.createReadStream(filepath), options)
.then(function(media) {
  console.log('Media successfully uploaded', media)
})
.catch(function(err) {
  console.log('Got err', err)
})
 
// Load existing media
mf.media(mediaId).then(function(media) {
  console.log('Media details', media)
})

Node style callbacks are also supported.

Roadmap

  • Get single media
  • Search medias
  • Signed requests as well as anonymous
  • Upload support
  • Set up Travis-CI
  • Promises based API
  • Set up tests to run in browser environments
  • Investigate providing as package for everything: npm + bower + amd + ES6

Readme

Keywords

Package Sidebar

Install

npm i mediaflow

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • nervetattoo