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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rio2016

v1.0.7

Published

Rio 2016 olympic games data

Readme

#Rio2016 Rio2016 module provides a set of functions to work with Rio 2016 Olympic games real time data.

##How to Install npm install rio2016

##Documentation Some functions available in the module:

###calendar( mode, lang, [ callback( obj ) ] ) It gets the olympic schedule from the official site and returns it as a JSON object.

####Arguments

  • mode: "full" to retrieve the complete calendar or a month day to retrieve the day activities
  • lang: pt_br, es, fr, en
  • callback: callback carrying the JSON object

###Examples

Retrieving the full calendar in brazilian portuguese:

var rio2016 = require( 'rio2016' );

rio2016.calendar('full', 'pt_br', function( obj ){
	console.log( obj );
});

JSON output:

[
   {
      "day":3,
      "events":{
         "Futebol":"competition"
      }
   },
   {
      "day":4,
      "events":{
         "Futebol":"competition"
      }
   },
   {
      "day":5,
      "events":{
         "Cerimônia":"cerimony",
         "Tiro com Arco":"competition"
      }
   },
   {
      "day":6,
      "events":{
         "Basquetebol":"competition",
         "Boxe":"competition",
         "Ciclismo de Estrada":"medal",
         "Esgrima":"medal",
         "Futebol":"competition",
         "Ginástica Artística":"competition",
         "Handebol":"competition",
         "Hipismo":"competition",
         "Hóquei sobre Grama":"competition",
         "Judô":"medal",
         "Levantamento de Peso":"medal",
         "Natação":"medal",
         "Polo Aquático":"competition",
         "Remo":"competition",
         "Rugby de 7":"competition",
         "Tiro com Arco":"medal",
         "Tiro Esportivo":"medal",
         "Tênis":"competition",
         "Tênis de Mesa":"competition",
         "Voleibol":"competition",
         "Vôlei de Praia":"competition"
      }
   },
   {
      "day":21,
      "events":{
         "Cerimônia":"cerimony",
         "Atletismo":"medal",
         "Basquetebol":"medal",
         "Boxe":"medal",
         "Ciclismo Mountain Bike":"medal",
         "Ginástica Rítmica":"medal",
         "Handebol":"medal",
         "Luta Olímpica":"medal",
         "Voleibol":"medal"
      }
   }
]

Retrieving events occurring in August 8th in english:

var rio2016 = require( 'rio2016' );

rio2016.calendar(8, 'en', function( obj ){
	console.log( obj );
});

JSON output:

{
   "Archery":"competition",
   "Artistic Gymnastics":"medal",
   "Basketball":"competition",
   "Beach Volleyball":"competition",
   "Boxing":"competition",
   "Canoe Slalom":"competition",
   "Diving":"medal",
   "Equestrian":"competition",
   "Fencing":"medal",
   "Handball":"competition",
   "Hockey":"competition",
   "Judo":"medal",
   "Rowing":"competition",
   "Rugby Sevens":"medal",
   "Sailing":"competition",
   "Shooting":"medal",
   "Swimming":"medal",
   "Table Tennis":"competition",
   "Tennis":"competition",
   "Volleyball":"competition",
   "Water Polo":"competition",
   "Weightlifting":"medal"
}

###sport( mode, lang, [ callback( obj ) ] ) It gets the olympic sports data from the official site and returns it as a JSON object.

####Arguments

  • mode: "all" to retrieve data of all sports or a sport name ("boxing") to retrieve from a specific one
  • lang: pt_br, es, fr, en
  • callback: callback carrying the JSON object

###Examples

Retrieving the full list of sports in brazilian portuguese:

var rio2016 = require( 'rio2016' );

rio2016.sport( 'all', 'pt_br', function( obj ){
   console.log( obj );
});

JSON output:

[
   {
      "name":"Badminton",
      "description":"Com petecas que podem voar a 400 km/h, o badminton exige reflexos rápidos dos jogadores – e atenção máxima do público. O esporte, que estreou em Barcelona 1992, tem torneios masculinos e femininos, individuais e de duplas, além de duplas mistas.",
      "records":{
         "male":[
            {
               "name":"Dong-Moon Kim",
               "nationality":"KOR",
               "gold":"2",
               "silver":"0",
               "bronze":"1"
            },
            {
               "name":"Lin Dan",
               "nationality":"CHN",
               "gold":"2",
               "silver":"0",
               "bronze":"0"
            },
            {
               "name":"Jun Zhang",
               "nationality":"CHN",
               "gold":"2",
               "silver":"0",
               "bronze":"0"
            }
         ],
         "female":[
            {
               "name":"Ling Gao",
               "nationality":"CHN",
               "gold":"2",
               "silver":"1",
               "bronze":"1"
            },
            {
               "name":"Young-Ah Gil",
               "nationality":"KOR",
               "gold":"1",
               "silver":"1",
               "bronze":"1"
            },
            {
               "name":"Zhao Yunlei",
               "nationality":"CHN",
               "gold":"2",
               "silver":"0",
               "bronze":"0"
            }
         ]
      }
   },
   {
      "name":"Atletismo",
      "description":"Corrida, saltos, lançamentos e arremessos. Um dos esportes mais tradicionais dos Jogos Olímpicos, o atletismo é disputado desde Atenas 1896, primeira edição da era moderna. É, hoje, o que distribui o maior número de medalhas: 141, sendo 47 de ouro.",
      "records":{
         "male":[
            {
               "name":"Paavo Nurmi",
               "nationality":"FIN",
               "gold":"9",
               "silver":"3",
               "bronze":"0"
            },
            {
               "name":"Carl Lewis",
               "nationality":"USA",
               "gold":"9",
               "silver":"1",
               "bronze":"0"
            },
            {
               "name":"Ray Ewry",
               "nationality":"USA",
               "gold":"8",
               "silver":"0",
               "bronze":"0"
            }
         ],
         "female":[
            {
               "name":"Merlene Ottey-Page",
               "nationality":"JAM",
               "gold":"0",
               "silver":"3",
               "bronze":"6"
            },
            {
               "name":"Irena Szewinska",
               "nationality":"POL",
               "gold":"3",
               "silver":"2",
               "bronze":"2"
            },
            {
               "name":"Veronica Campbell-Brown",
               "nationality":"JAM",
               "gold":"3",
               "silver":"2",
               "bronze":"2"
            }
         ]
      }
   }
]

Retrieving Boxing data in english:

var rio2016 = require( 'rio2016' );

rio2016.sport( 'boxing', 'en', function( obj ){
   console.log( obj );
});

JSON output:

{
   "name":"Boxing",
   "description":"Jabs, crosses, uppercuts... a single punch can make all the difference in boxing. The sport made its Olympic debut at St Louis 1904 and women entered the fray at London 2012. At Rio 2016, there are 13 categories – 10 for men and three for women.",
   "records":{
      "male":[
         {
            "name":"Teófilo Steveson",
            "nationality":"CUB",
            "gold":"3",
            "silver":"0",
            "bronze":"0"
         },
         {
            "name":"Lázló Papp",
            "nationality":"HUN",
            "gold":"3",
            "silver":"0",
            "bronze":"0"
         },
         {
            "name":"Félix Savón",
            "nationality":"CUB",
            "gold":"3",
            "silver":"0",
            "bronze":"0"
         }
      ],
      "female":[
         {
            "name":"Nicola Adams",
            "nationality":"GBR",
            "gold":"1",
            "silver":"0",
            "bronze":"0"
         },
         {
            "name":"Katie Taylor",
            "nationality":"IRL",
            "gold":"1",
            "silver":"0",
            "bronze":"0"
         },
         {
            "name":"Claressa Shields",
            "nationality":"USA",
            "gold":"1",
            "silver":"0",
            "bronze":"0"
         }
      ]
   }
}

###medal( mode, lang, [ callback( obj ) ] ) It gets the olympic medals from the official site and returns it as a JSON object.

####Arguments

  • mode: "all" to retrive all countries with the respective medals (countries that already have any medal)
  • lang: pt_br, es, fr, en
  • callback: callback carrying the JSON object

###Examples

Retrieving all countries medals in portuguese.

var rio2016 = require( 'rio2016' );

rio2016.medal( 'all', 'pt_br', function( obj ){
   console.log( obj );
});

JSON output:

[ { "name": "Bélgica",
    "abr": "BEL",
    "gold": "1",
    "silver": "0",
    "bronze": "0",
    "total": "1" },
  { "name": "Cazaquistão",
    "abr": "KAZ",
    "gold": "0",
    "silver": "0",
    "bronze": "1",
    "total": "1" },
  { "name": "Polônia",
    "abr": "POL",
    "gold": "0",
    "silver": "0",
    "bronze": "1",
    "total": "1" } ]

Retrieving medals of Brazil in english

var rio2016 = require( 'rio2016' );

rio2016.medal( 'BRA', 'en', function( obj ){
   console.log( obj );
});

JSON output:

{ "name": "Brazil",
  "abr": "BRA",
  "gold": "0",
  "silver": "1",
  "bronze": "0",
  "total": "1" }