       else 0
 
     callback null, jobs
+
+  formatJobs: (queue = "*", keys, callback) ->
+    states = ["active", "completed", "delayed", "failed", "wait", "stuck"]
+    @formatJobsForStates queue, states, keys, callback
 
   commandRemoveFromStateLists: (prefix, id) -> [
     ["lrem", "#{prefix}active",     0, id]


    await @idsAndCountByState queue, state,  ideally defer list
    await @fullKeysForList list,             ideally defer names
    await @formatJobs queue, names,          ideally defer jobs
    await @dataForJobs jobs,                 ideally defer jobs
    await @stacktraceForJobs jobs,           ideally defer jobs if state is "failed"
    await @progressForJobs jobs,             ideally defer jobs if state is "active"

    callback null, keys

  #Returns all jobs in object form, with state applied to object. Ex: {id: 101, queue: "video transcoding", state: "pending"}
  formatJobsForState: (queue = "*", state, keys, callback) ->
    @formatJobsForStates queue, [state], keys, callback

  formatJobsForStates: (queue = "*", states, keys, callback) ->
    return callback() unless keys?.length
    ideally = errify callback
    jobs    = []

    for state in states
      await @idsAndCountByState queue, state, ideally defer {ids}
