Skip to content

Commit 3d11cdc

Browse files
Bart van Andeladam-waldenberg
Bart van Andel
authored andcommitted
Setup npm package
1 parent 315f407 commit 3d11cdc

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ build
22
debian
33
deb_dist
44
dist
5+
node_modules
56
*.egg-info
67
*.pyc
8+
*.tgz

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Below are some example outputs for a number of famous open source projects. All
3535
### The Team
3636
* Adam Waldenberg, Lead maintainer and Swedish translation
3737
* Agustín Cañas, Spanish translation
38+
* Bart van Andel, npm package maintainer
3839
* Bill Wang, Chinese translation
3940
* Christian Kastner, Debian package maintainer
4041
* Jiwon Kim, Korean translation
@@ -49,5 +50,7 @@ Below are some example outputs for a number of famous open source projects. All
4950
### Packages
5051
The Debian packages offered with releases of gitinspector are unofficial and very simple packages generated with [stdeb](https://github.com/astraw/stdeb). Christian Kastner is maintaining the official Debian packages. You can check the current status on the [Debian Package Tracker](https://tracker.debian.org/pkg/gitinspector). Consequently, there are official packages for many Debian based distributions installable via *apt-get*.
5152

53+
An [npm](https://npmjs.com) package is provided for convenience as well. To install it globally, execute `npm i -g gitinspector`.
54+
5255
### License
5356
gitinspector is licensed under the *GNU GPL v3*. The gitinspector logo is partly based on the git logo; based on the work of Jason Long. The logo is licensed under the *Creative Commons Attribution 3.0 Unported License*.

gitinspector.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
var PythonShell = require('python-shell');
2+
3+
var options = {
4+
// The main python script is in the same directory as this file
5+
scriptPath: __dirname,
6+
7+
// Get command line arguments, skipping the default node args:
8+
// arg0 == node executable, arg1 == this file
9+
args: process.argv.slice(2)
10+
};
11+
12+
13+
// Set encoding used by stdin etc manually. Without this, gitinspector may fail to run.
14+
process.env.PYTHONIOENCODING = 'utf8';
15+
16+
// Start inspector
17+
var inspector = new PythonShell('gitinspector.py', options);
18+
19+
// Handle stdout
20+
inspector.on('message', function(message) {
21+
console.log(message);
22+
});
23+
24+
// Let the inspector run, catching any error at the end
25+
inspector.end(function (err) {
26+
if (err) {
27+
throw err;
28+
}
29+
});

package.json

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "gitinspector",
3+
"version": "0.5.0-dev",
4+
"description": "Gitinspector is a statistical analysis tool for git repositories. The default analysis shows general statistics per author, which can be complemented with a timeline analysis that shows the workload and activity of each author. Under normal operation, it filters the results to only show statistics about a number of given extensions and by default only includes source files in the statistical analysis.",
5+
"main": "gitinspector.py",
6+
"directories": {
7+
"doc": "docs",
8+
"test": "tests"
9+
},
10+
"scripts": {
11+
"clean": "rimraf **/*.pyc",
12+
"prepublish": "npm run clean",
13+
"release": "with-package git commit -am pkg.version && with-package git tag pkg.version && git push && npm publish && git push --tags",
14+
"release:beta": "npm run release && npm run tag:beta",
15+
"tag:beta": "with-package npm dist-tag add [email protected] beta",
16+
"test": "echo \"Error: no test specified\" && exit 1"
17+
},
18+
"bin": {
19+
"gitinspector": "gitinspector.py"
20+
},
21+
"repository": {
22+
"type": "git",
23+
"url": "git+https://github.com/ejwa/gitinspector.git"
24+
},
25+
"keywords": [
26+
"git",
27+
"statistics",
28+
"stats"
29+
],
30+
"author": {
31+
"name": "Adam Waldenberg",
32+
"email": "[email protected]",
33+
"url": "https://github.com/adam-waldenberg"
34+
},
35+
"contributors": [
36+
"Agustín Cañas",
37+
"Bart van Andel <[email protected]>",
38+
"Bill Wang",
39+
"Christian Kastner",
40+
"Jiwon Kim",
41+
"Kamila Chyla",
42+
"Luca Motta",
43+
"Philipp Nowak",
44+
"Sergei Lomakov",
45+
"Yannick Moy"
46+
],
47+
"license": "GPL-3.0",
48+
"bugs": {
49+
"url": "https://github.com/ejwa/gitinspector/issues"
50+
},
51+
"homepage": "https://github.com/ejwa/gitinspector#readme",
52+
"devDependencies": {
53+
"rimraf": "^2.5.4",
54+
"with-package": "^0.2.0"
55+
},
56+
"dependencies": {
57+
"python-shell": "^0.4.0"
58+
}
59+
}

0 commit comments

Comments
 (0)