npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qboss-lib

v1.0.6

Published

- responsible to generate jobs for qboss project. It wraps some metadata around payload to help qboss-client and -server - can optionally pull jobs and messages from sqs down - onces pulled a message, it can delete this message

Downloads

10

Readme

qboss library

  • responsible to generate jobs for qboss project. It wraps some metadata around payload to help qboss-client and -server
  • can optionally pull jobs and messages from sqs down
    • onces pulled a message, it can delete this message

installation

npm i --save qboss-lib

API

Create an instance

var q = new qboss({ folder: '/tmp', sqs })

depending on use case you might either define folder or sqs or both as options. if you want to pull, you need to instantiate a sqs object by using aws-sdk

Create Jobs

.compose : will only return a string as a job

.submit : will create a job inside folder directory which then will be picken up from qboss-client

Pull and Manage Jobs

.pull(QueueUrl) <Promise> : will pull a message form sqs and return a job object

Job Object

.delete() <Promise> : will delete the job from sqs

.getJob() : will only return the job part of the qboss message

.getMessage() : will return sqs message body

.getRaw() : development related

create jobs

var qboss = require('qboss-lib')

// init to create jobs
var q = new qboss({ folder: '/tmp/'})
var payload = {
    name:'john',
    lastname:'doe',
    type:'newperson'
}

// just output to console
console.log(q.compose('test.fifo','secret',payload))
// create a job inside /tmp
q.submit('test.fifo','secret',payload)

pulling jobs

var AWS = require('aws-sdk')
AWS.config.update({region: 'us-east-1'})
var sqs = new AWS.SQS({apiVersion: '2012-11-05',accessKeyId:"OR7R474F42F84FFFASPP",secretAccessKey:"0f7a54e0-e673-46f1-8846-c98f4b288b3a"});

// instantiate
var q = new qboss({
    sqs
})

// pull
q.pull('https://sqs.us-east-2.amazonaws.com/593153579764/test.fifo').then(async function (job) {
    console.log(job.getJob())
    // process
    ....
    // delete
    await job.delete()
}).catch(err=>{
    console.log(err)
})

structure or created job

{
  "version": 1,
  "token": "secret",
  "libversion": "1.0.2",
  "t": 1558340983844,
  "id": "2ca6a173-7a58-4d24-8860-acb8d0225c90",
  "hostname": "Mac-Pro.local",
  "qname": "test.fifo",
  "payload": {
    "name": "john",
    "lastname": "doe",
    "type": "newperson"
  }
}