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

sports-live

v1.0.1

Published

Get Live Sports Updates Absolutely FREE in your NodeJS

Downloads

13

Readme

#INTRODUCTION

With sports-live NPM package, you can extract highly accurate live updates about various popular sports absolutely FREE. The current API version is bundled with two key functions as mentioned below:

i) getAllMatches(sport):

-> It takes the sport’s name as an argument and gives you the output containing all the latest matches with live scores for the desired sport.

ii) getLiveScores(sport,team1,team2):

-> It takes three argument where team1 and team2 signifies the names of the opponents playing the sport. It gives the output as the live score for the concerned match.

#SETUP: var api = require('sports-live');

#USAGE:

This can help you understand the various arguments and callbacks involved, as shown below,

  1. api.getAllMatches(“tennis”,function(err,matches){ if (err) { console.log(err.message); } else { console.log(matches); } });

Output:

[ { team1: 'Golubic V.', team2: 'Siegemund L', score: '2-0', currentStatus: 'Match Finished' }, { team1: 'Youzhny M.', team2: 'Almagro N', score: '1-1', currentStatus: ‘3rd Set' }, { team1: ‘Murray A.’, team2: ‘Dimitrov G.’, score: '2-0', currentStatus: 'Match Finished' }, { team1: 'Karlovic I.', team2: 'Pospisil V', score: '0-2', currentStatus: 'Match Finished' }]

  1. api.getLiveScores(“tennis”,”murray”,”dimitrov”,function(err,match) { if (err) { console.log(err.message); } else { console.log(match); } });

Output:

{ team1: ‘Murray A.’, team2: ‘Dimitrov G.’, score: '2-0', currentStatus: 'Match Finished' }

In case the match isn't going on, you’ll get a message saying: “No match available for mentioned sport or Team”

Have a look at the output of test.js for better understanding.

#IMPORTANT POINTS:

  1. The available sports as of now are :

a) Cricket b) Soccer (European leagues) c) Baseball d) American Football e) Tennis f) Ice Hockey

  1. To enter multi-word sport name or team name, it is recommended to have NO SPACES and UNDERSCORE for differentiation e.g:

Cricket Match between India & New Zealand, then type

api.getLiveScores(“cricket”,”india”,”new_zealand”,function(err,match) { if (err) { console.log(err.message); } else { console.log(match); } });

  1. For cricket the O/P convention is bit different than other sport due to its scoring pattern, an example can help you understand. (output for above match)

Output: { "team1": "India 557/5 , 18 *", "team2": "New Zealand 299/10", "score": " ", "currentStatus": " " }