How to use transloadit - 4 common examples

To help you get started, we’ve selected a few transloadit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github transloadit / transloadify / test / end-to-end.js View on Github external
return () => {
    let dirname = path.join(tmpDir, `transloadify_test_${testno++}`)
    let client = new TransloaditClient({ authKey, authSecret })
    return Q.nfcall(fs.mkdir, dirname)
      .then(() => {
        for (let evt of ['exit', 'SIGINT', 'uncaughtException']) {
          process.on(evt, () => {
            try {
              rimraf.sync(dirname)
            } catch (e) {
              if (e.code !== 'ENOENT') throw e
            }
            process.exit()
          })
        }
        process.chdir(dirname)
        return cb(client)
      }).fin(() => {
        process.chdir(cwd)
github transloadit / transloadify / test / end-to-end.js View on Github external
after(function () {
        let client = new TransloaditClient({ authKey, authSecret })
        return Q.nfcall(client.deleteTemplate.bind(client), templateId)
      })
    })
github transloadit / transloadify / test / end-to-end.js View on Github external
before(function () {
        let client = new TransloaditClient({ authKey, authSecret })
        return Q.nfcall(client.createTemplate.bind(client), {
          name: 'originalName',
          template: JSON.stringify({ stage: 0 })
        }).then(response => { templateId = response.id })
      })
github transloadit / transloadify / src / index.js View on Github external
'assembly-notifications': require('./notifications'),
  bills: require('./bills'),
  help
}

let command = commands[invocation.mode]
if (invocation.action) command = command[invocation.action]

let client
if (!['help', 'version', 'register'].indexOf(invocation.mode) !== -1) {
  if (!process.env.TRANSLOADIT_KEY || !process.env.TRANSLOADIT_SECRET) {
    output.error('Please provide API authentication in the environment variables TRANSLOADIT_KEY and TRANSLOADIT_SECRET')
    process.exit(1)
  }

  client = new TransloaditClient({
    authKey: process.env.TRANSLOADIT_KEY,
    authSecret: process.env.TRANSLOADIT_SECRET
  })
}

command(output, client, invocation)

transloadit

Node.js SDK for Transloadit

MIT
Latest version published 3 years ago

Package Health Score

64 / 100
Full package analysis

Popular transloadit functions