@nexrender/api
If you want to use nexrender API from browser/nodejs env you can use this module, instead of manually sending HTTP requests.
Last updated 3 months ago by inlife .
Original npm · Tarball · package.json
$ cnpm install @nexrender/api 
SYNC missed versions from official npm registry.

API

If you want to use nexrender API from browser/nodejs env you can use this module, instead of manually sending HTTP requests.

Installation

npm install @nexrender/api --save

Usage

const { createClient } = require('@nexrender/api')

const client = createClient({
    host: 'http://my.server.com:3050',
    secret: 'myapisecret',
})

const main = async () => {
    const result = await client.addJob({
        template: {
            src: 'http://my.server.com/assets/project.aep',
            composition: 'main',
        }
    })

    result.on('created', job => console.log('project has been created'))
    result.on('started', job => console.log('project rendering started'))
    result.on('finished', job => console.log('project rendering finished'))
    result.on('error', err => console.log('project rendering error', err))
}

main().catch(console.error);

Information

Main returned function is createClient which allows you to create multiple clients to work with multiple endpoints in case it might be needed.

Instead of returning Job object, client.addJob returns an event emitter instance, which allows you to bind your callbacks and handle changes in the Job lifetime. API will be constantly polling the specific API server every NEXRENDER_JOB_POLLING ms for changes, and if there will be any - you will be notified.

Current Tags

  • 1.5.7                                ...           latest (3 months ago)

15 Versions

  • 1.5.7                                ...           3 months ago
  • 1.5.0                                ...           4 months ago
  • 1.0.3                                ...           8 months ago
  • 1.0.0                                ...           8 months ago
  • 1.0.0-alpha.15                                ...           8 months ago
  • 1.0.0-alpha.14                                ...           8 months ago
  • 1.0.0-alpha.13                                ...           8 months ago
  • 1.0.0-alpha.11                                ...           8 months ago
  • 1.0.0-alpha.10                                ...           8 months ago
  • 1.0.0-alpha.9                                ...           8 months ago
  • 1.0.0-alpha.6                                ...           8 months ago
  • 1.0.0-alpha.5                                ...           8 months ago
  • 1.0.0-alpha.3                                ...           8 months ago
  • 1.0.0-alpha.2                                ...           8 months ago
  • 1.0.0-alpha.1                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 3
Last Day 0
Last Week 1
Last Month 34
Dependencies (2)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |