<commit_before>/*!
 * npm-info <https://github.com/doowb/npm-info>
 *
 * Copyright (c) 2016, <NAME>.
 * Licensed under the MIT License.
 */

'use strict';

var npm = require('../')();
var repo = npm.repo('micromatch');
repo.downloads(function(err, downloads) {
  if (err) return console.error(err);
  console.log(downloads.length + ' days of downloads have been pulled for micromatch');
  console.log();
  repo.total(function(err, total) {
    if (err) return console.error(err);
    console.log('total:', total);
    repo.last(30, function(err, total) {
      if (err) return console.error(err);
      console.log('last 30 days:', total);
      repo.last(7, function(err, total) {
        if (err) return console.error(err);
        console.log('last 7 days:', total);
        repo.last(1, function(err, total) {
          if (err) return console.error(err);
          console.log('last day:', total);
        });
      });
    });
  });
});<commit_msg>update example using firebasebase store<commit_after>/*!
 * npm-info <https://github.com/doowb/npm-info>
 *
 * Copyright (c) 2016, <NAME>.
 * Licensed under the MIT License.
 */

'use strict';

// // default using memory store
// var npm = require('../')();

// // using data store
// var npm = require('../')({
//   store: require('../lib/stores/data')()
// });

// using firebase store
var Firebase = require('firebase');
var npm = require('../')({
  store: require('../lib/stores/firebase')(new Firebase('https://assemblebot.firebaseio.com/stats'))
});

var repo = npm.repo('micromatch');
repo.downloads(function(err, downloads) {
  if (err) return console.error(err);
  console.log(downloads.length + ' days of downloads have been pulled for micromatch');
  console.log();
  repo.total(function(err, total) {
    if (err) return console.error(err);
    console.log('total:', total);
    repo.last(30, function(err, total) {
      if (err) return console.error(err);
      console.log('last 30 days:', total);
      repo.last(7, function(err, total) {
        if (err) return console.error(err);
        console.log('last 7 days:', total);
        repo.last(1, function(err, total) {
          if (err) return console.error(err);
          console.log('last day:', total);
          process.exit();
        });
      });
    });
  });
});
{'fraction_non_alphanumeric': 0.18823529411764706, 'fraction_numerical': 0.009586056644880174, 'mean_word_length': 3.021015761821366, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5299881', 'n_tokens_mistral': 766, 'n_tokens_neox': 733, 'n_words': 181}