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

lumenode

v1.0.3

Published

- fetch repository - run `npm i` - run app with `gulp start` or `npm start` or `node app.js` and u are good to go

Downloads

7

Readme

Install

  • fetch repository
  • run npm i
  • run app with gulp start or npm start or node app.js and u are good to go

Commands

  • gulp test -> execute tests with codecoverage
  • gulp tdd -> run test on file changes
  • gulp runMocha -> run test single time
  • gulp lint -> check codestyle with eslint

Create new action (create/void/.../remove event/market/selection)

  • test XMLGenerator -- copy it() -- set expectations (It is VERY(!) important. Set every important field) -- follow errors --- create key in XMLGenerator --- create XML template for action -- red - green - refactor -- done.

  • test OpenbetPublisher -- copy it() -- create expected response from OB --- with success --- with error -- red - green - refactor -- done.

  • test Output -- create new [action]Spec for [action]Output -- set expectations -- red --- create new [action]Output --- implement ::map() --- set whitelist for ::validateStatus() -- red - green - refactor -- done.

  • test Event (Integration suite) -- copy it() -- set expectations -- red --- create/implement Event --- create real/debug MQs -- red - green - refactor -- done.

Few words about publishing HR (events, markets, selections)

  • You should send only structured data via RabbitMQ (sport, area, ..., selection)
  • You can not send ONLY: event or selection

HR responses: If everything went good you will be received with this sample of data:

{
    events: [{
        openbetId: "1849938",
        sparkId: "111111"
    }, {
        openbetId: "1849939",
        sparkId: "111112"
    }],
    markets: [{
        openbetId: "21728593",
        sparkId: "777771"
    }],
    selections: [{
        openbetId: "116498850",
        sparkId: "100000"
    }, {
        openbetId: "116498851",
        sparkId: "200000"
    }, {
        openbetId: "116498852",
        sparkId: "300000"
    }]
}

As you can see we got array of spark and openbet IDs. Map them and you are good to go.

Still there are some moments that OB could probably fail. For example if event already exists or it is not valid -> we will see something like:

{
    events: [{
        openbetId: "error",
        sparkId: "111111",
        debug: {
            code: '354',
            message: '{event already exists}',
            humanReadable: 'Event already exists'
        }
    }, {
        openbetId: "error",
        sparkId: "111112",
        debug: {
            code: '354',
            message: '{event already exists}',
            humanReadable: 'Event already exists'
        }
    }],
    markets: [{
        openbetId: "error",
        sparkId: "parent_error",
        debug: {
            code: '150',
            message: '',
            humanReadable: 'Successfully validated XML'
        }
    }],
    selections: [{
        openbetId: "error",
        sparkId: "parent_error",
        debug: {
            code: '150',
            message: '',
            humanReadable: 'Successfully validated XML'
        }
    }, {
        openbetId: "error",
        sparkId: "parent_error",
        debug: {
            code: '150',
            message: '',
            humanReadable: 'Successfully validated XML'
        }
    }, {
        openbetId: "error",
        sparkId: "parent_error",
        debug: {
            code: '150',
            message: '',
            humanReadable: 'Successfully validated XML'
        }
    }]
}

Yep, openbetId has value of error. You could easely handle this. Still if you look closely you will see notice parent_error error. It means that we got error somewhere else on the higher level of hierarchy.

For example:

  • event -> market
  • market -> selection
  • etc..

Also I will put some other error cases (just in case): Error on market level:

{
    events: [{
        openbetId: "1849938",
        sparkId: "111111"
    }, {
        openbetId: "1849939",
        sparkId: "111112"
    }],
    markets: [{
        openbetId: "error",
        sparkId: "777771",
        debug: {
            code: '404',
            message: '{market already exists}',
            humanReadable: 'Market already exists'
        }
    }],
    selections: [{
        openbetId: "error",
        sparkId: "parent_error",
        debug: {
            code: '150',
            message: '',
            humanReadable: 'Successfully validated XML'
        }
    }, {
        openbetId: "error",
        sparkId: "parent_error",
        debug: {
            code: '150',
            message: '',
            humanReadable: 'Successfully validated XML'
        }
    }, {
        openbetId: "error",
        sparkId: "parent_error",
        debug: {
            code: '150',
            message: '',
            humanReadable: 'Successfully validated XML'
        }
    }]
};

Error on selection level:

{
    events: [{
        openbetId: "1850151",
        sparkId: "111111"
    }, {
        openbetId: "1850152",
        sparkId: "111112"
    }],
    markets: [{
        openbetId: "21729734",
        sparkId: "777771"
    }],
    selections: [{
        openbetId: "error",
        sparkId: "9999944444",
        debug: {
            code: '454',
            message: '{selection already exists}',
            humanReadable: 'Selection already exists'
        }
    }, {
        openbetId: "error",
        sparkId: "9999955555",
        debug: {
            code: '454',
            message: '{selection already exists}',
            humanReadable: 'Selection already exists'
        }
    }, {
        openbetId: "error",
        sparkId: "9999966666",
        debug: {
            code: '454',
            message: '{selection already exists}',
            humanReadable: 'Selection already exists'
        }
    }]
}

License

© Iurii Krevnyi