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

git-stat-project

v0.5.2

Published

A tool for git projects statistics generation per every user.

Downloads

28

Readme

Git project stat

A tool for git projects statistics generation per every user.

What does the result look like?

I've used rship repo for this example.

pkondratenko:~/projects/experimental/git-stat-project (*)
> yarn start -- --folder ~/projects/tmp/rship --after 01.01.2017 --before 31.12.2017
yarn start v0.18.1
$ node ./script.js --folder /Users/pkondratenko/projects/tmp/rship --after 01.01.2017 --before 31.12.2017

Commits pushed report
  User name                                Total value ratio                                   Count
  [email protected]               |██████████████████████████████████████████████████     16
  [email protected]                        |█████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░      3
  [email protected]                              |██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░      2
  [email protected]  |███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░      1
  [email protected]                        |███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░      1

Lines affected report (added plus removed)
  User name                                Total value ratio                                   Count
  [email protected]               |██████████████████████████████████████████████████    691
  [email protected]                        |█████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░     63
  [email protected]                              |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░     20
  [email protected]                        |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░      4
  [email protected]  |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░      0

Lines diff report (added minus removed)
  User name                                Total value ratio                                   Count
  [email protected]  ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░      0
  [email protected]                              ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░      0
  [email protected]                        ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░      0
  [email protected]               ░░░░█████████████████████|░░░░░░░░░░░░░░░░░░░░░░░░░    -33
  [email protected]                        █████████████████████████|░░░░░░░░░░░░░░░░░░░░░░░░░    -39

Done in 0.33s.

Requirements

If you want to use this in your console, you need to use node.js >= 7.1.

Installation as a global package

1. Install via npm

npm install -g git-stat-project

2. Use through console

git-stat-project --folder ~/projects/project --after 01.01.2017 --before 01.12.2017

Installation as separate project

1. Clone the repo

git clone [email protected]:gustarus/git-stat-project.git && cd git-stat-project

2. Use needed node.js version

nvm use

3. Install dependencies

yarn

Or via npm:

npm i

4. Use through console

Clone and install this project and then type in console from this project dir:

yarn start -- --folder ~/projects/project --after 01.01.2017 --before 01.12.2017

Or via npm:

npm start -- --folder ~/projects/project --after 01.01.2017 --before 01.12.2017

How you can use this in your project?

This code u can find in script.js.

const stat = require('git-stat-project');
const {helpers, Log, GitProject, CommitsReport, LinesAffectedReport, LinesDiffReport} = stat;
const {getArgv} = helpers;

const {folder, before, after} = getArgv(process.argv);
const reports = [CommitsReport, LinesAffectedReport, LinesDiffReport];

const log = new Log();
const git = new GitProject({folder});
git.stat(after, before).then(collection => {
  if (!Object.keys(collection).length) {
    throw new Error('There is no history for this project. May be the folder is incorrect?');
  }

  return reports.map(Report => {
    const report = new Report({collection});
    const records = report.generate();
    return report.render(records);
  });
}).then(blocks => {
  log.info('\n' + blocks.join('\n\n') + '\n');
}).catch(error => {
  log.error(`\n${error.stack}\n`);
  process.exit(1);
});

Which kinds of reports do you have?

Each report can be required with the following syntax (where collection - git statistic results from GitProject instance):

const {GeneralReport} = require('git-stat-project');
const report = new Report({collection});
const records = report.generate();
return report.render(records);

GeneralReport

General report - commits pushed and lines affected ratio
  User name                                Percents value                                       Commits  Lines
  [email protected]               |██████████████████████████████████████████████████       16    691
  [email protected]                        |██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        3     63
  [email protected]                              |███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        2     20
  [email protected]                        |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        1      4
  [email protected]  |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        1      0

CommitsReport

Commits pushed report
  User name                                Total value ratio                                    Commits
  [email protected]               |██████████████████████████████████████████████████       16
  [email protected]                        |█████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        3
  [email protected]                              |██████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        2
  [email protected]  |███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        1
  [email protected]                        |███░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        1

LinesAddedReport

Lines added report
  User name                                Total value ratio                                    Added
  [email protected]               |██████████████████████████████████████████████████    329
  [email protected]                        |██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░     12
  [email protected]                              |██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░     10
  [email protected]                        |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░      2
  [email protected]  |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░      0

LinesRemovedReport

Lines removed report
  User name                                Total value ratio                                    Removed
  [email protected]               |██████████████████████████████████████████████████      362
  [email protected]                        |███████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░       51
  [email protected]                              |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░       10
  [email protected]                        |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        2
  [email protected]  |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        0

LinesDiffReport

Lines diff report (added minus removed)
  User name                                Total value ratio                                    Diff
  [email protected]  ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░     0
  [email protected]                              ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░     0
  [email protected]                        ░░░░░░░░░░░░░░░░░░░░░░░░░|░░░░░░░░░░░░░░░░░░░░░░░░░     0
  [email protected]               ░░░░█████████████████████|░░░░░░░░░░░░░░░░░░░░░░░░░   -33
  [email protected]                        █████████████████████████|░░░░░░░░░░░░░░░░░░░░░░░░░   -39

LinesAffectedReport

Lines affected report (added plus removed)
  User name                                Total value ratio                                    Affected
  [email protected]               |██████████████████████████████████████████████████       691
  [email protected]                        |█████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        63
  [email protected]                              |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░        20
  [email protected]                        |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░         4
  [email protected]  |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░         0

What does the module export?

// base components
module.exports.Base = require('./components/base/base');
module.exports.Log = require('./components/base/log');
module.exports.GitProject = require('./components/base/git-project');
module.exports.Report = require('./components/base/report');
module.exports.KeyReport = require('./components/base/key-report');
module.exports.Table = require('./components/base/table');

// key reports
module.exports.CommitsReport = require('./components/reports/key/commits');
module.exports.LinesDiffReport = require('./components/reports/key/lines-diff');
module.exports.LinesAddedReport = require('./components/reports/key/lines-added');
module.exports.LinesRemovedReport = require('./components/reports/key/lines-removed');
module.exports.LinesAffectedReport = require('./components/reports/key/lines-affected');

// more complicated reports
module.exports.GeneralReport = require('./components/reports/general');