@lukekarrys/score-watcher

Score watcher for brakcet.club.

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
10Mar 26, 2021Mar 22, 2013Minified + gzip package size for @lukekarrys/score-watcher in KB

Readme

score-watcher

Greenkeeper badge Build Status

Score watcher for bracket.club.

Usage

const ScoreWatcher = require('score-watcher');

new ScoreWatcher({
    // Required
    sport: 'ncaam',
    year: '2015',
    // An optional bracket to initialize the updater with
    // Will default to an empty bracket for the sport/year
    master: '',
    // Optional log file
    logger: null,
    // The callbacks
    onSave: function (master, cb) {
        // Will be called with each master as a string
        // `cb` is optional but should be used to ensure
        // that each bracket is saved before moving to
        // the next one
    },
    scores: {
        // Config for scores module
        interval: '1m',
        url: 'http://url.com'
    }
}).start();

What is it doing?

It is setting up an async.queue and creating a watcher/emitter with scores. Then every time the queue drains, it calls onSave with the latest master (and an optional callback to notify the watcher when it has been added).

Is it on npm?

Yeah, now that there are publically scoped modules it's at npm install @lukekarrys/score-watcher.

LICENSE

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.