<commit_before># npm-stats [![Build Status](https://travis-ci.org/jaxgeller/npm-stats.svg?branch=master)](https://travis-ci.org/jaxgeller/npm-stats)
Ever wonder how much of your life you spend on npm installs? npm-stats logs how much time you spend running npm commands.

### Installation

```sh
npm install npmstats -g
echo "source $HOME/.npm-stats/npm-stats.sh" >> some_*rc
```

or

+ Clone this repo to your home like, `$HOME/.npm-stats`
+ Source this script with your profile of choice. Make sure to add it at the end

```sh
mkdir -p "$HOME/.npm-stats"
git clone https://github.com/jaxgeller/npm-stats "$HOME/.npm-stats"
echo "source $HOME/.npm-stats/npm-stats.sh" >> some_*rc
```

### Usage

npm-stats will hook into npm automatically, all you need to do is run `npm-stats` whenever you want some sweet stats.

```sh
npm-stats v1.0.0

Usage:
  npm-stats             Show stats in human readable format
  npm-stats dates       Just show date data
  npm-stats timing      Just show timing data
  npm-stats graph       Show a graph of the stats
  npm-stats raw         Outputs raw data
  npm-stats help        Show this message
  npm-stats version     Show the current version installed
```

### How it works

npm-stats is a simple bash script. When you source it into your shell, it acts as a simple pre-filter to npm. If you run any command associated with installing, it appends to a log at `~/.npm-stats/timing` with the date and how long it took in seconds.

npm-stats also provides some helper functions to help understand the logging, such as graphing and parsing the log.

__Note: graphing requires gnuplot__

### Updating

If you used npm, just run `npm update npmstats -g`.
Otherwise, updating is simple, just cd into `$HOME/.npm-stats`, run git pull, and refresh the shell.

### Examples

```sh
$ npm-stats

You've run npm install 8 times. For a total of 28 seconds.
```

```sh
$ npm-stats graph

                         npm install timing distribution
<commit_msg>Fix example displaing<commit_after># npm-stats [![Build Status](https://travis-ci.org/jaxgeller/npm-stats.svg?branch=master)](https://travis-ci.org/jaxgeller/npm-stats)
Ever wonder how much of your life you spend on npm installs? npm-stats logs how much time you spend running npm commands.

### Installation

```sh
npm install npmstats -g
echo "source $HOME/.npm-stats/npm-stats.sh" >> some_*rc
```

or

+ Clone this repo to your home like, `$HOME/.npm-stats`
+ Source this script with your profile of choice. Make sure to add it at the end

```sh
mkdir -p "$HOME/.npm-stats"
git clone https://github.com/jaxgeller/npm-stats "$HOME/.npm-stats"
echo "source $HOME/.npm-stats/npm-stats.sh" >> some_*rc
```

### Usage

npm-stats will hook into npm automatically, all you need to do is run `npm-stats` whenever you want some sweet stats.

```sh
npm-stats v1.0.0

Usage:
  npm-stats             Show stats in human readable format
  npm-stats dates       Just show date data
  npm-stats timing      Just show timing data
  npm-stats graph       Show a graph of the stats
  npm-stats raw         Outputs raw data
  npm-stats help        Show this message
  npm-stats version     Show the current version installed
```

### How it works

npm-stats is a simple bash script. When you source it into your shell, it acts as a simple pre-filter to npm. If you run any command associated with installing, it appends to a log at `~/.npm-stats/timing` with the date and how long it took in seconds.

npm-stats also provides some helper functions to help understand the logging, such as graphing and parsing the log.

__Note: graphing requires gnuplot__

### Updating

If you used npm, just run `npm update npmstats -g`.
Otherwise, updating is simple, just cd into `$HOME/.npm-stats`, run git pull, and refresh the shell.

### Examples

```
$ npm-stats

You've run npm install 8 times. For a total of 28 seconds.
```

```sh
$ npm-stats graph

                         npm install timing distribution

{'fraction_non_alphanumeric': 0.0963673057517659, 'fraction_numerical': 0.0030272452068617556, 'mean_word_length': 3.2497320471597, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3122225', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1145, 'n_words': 523}