Gathering detailed insights and metrics for package.json
Gathering detailed insights and metrics for package.json
Gathering detailed insights and metrics for package.json
Gathering detailed insights and metrics for package.json
package-json
Get metadata of a package from the npm registry
sort-package-json
Sort an Object or package.json based on the well-known package.json keys
read-package-json
The thing npm uses to read package.json files with semantics and defaults and validation
package-json-from-dist
Load the local package.json from either src or dist folder
npm install package.json
Typescript
Module System
Node Version
NPM Version
82.9
Supply Chain
91
Quality
72.2
Maintenance
25
Vulnerability
99.3
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
8,995,115
Last Day
5,503
Last Week
35,520
Last Month
156,495
Last Year
2,834,202
MIT License
5 Stars
29 Commits
6 Forks
4 Watchers
1 Branches
1 Contributors
Updated on Feb 14, 2025
Minified
Minified + Gzipped
Latest Version
2.0.1
Package Id
package.json@2.0.1
Size
5.17 kB
NPM Version
3.7.3
Node Version
5.9.0
Published on
Aug 31, 2016
Cumulative downloads
Total Downloads
Last Day
-17.5%
5,503
Compared to previous day
Last Week
-0.7%
35,520
Compared to previous week
Last Month
42.1%
156,495
Compared to previous month
Last Year
122.6%
2,834,202
Compared to previous year
3
Get the package.json content either from npm or from a git repository.
1$ npm i --save pkg.json
1const packageJson = require("pkg.json"); 2 3packageJson("git-stats", function (err, data) { 4 console.log(err || data); 5 // { _id: 'git-stats', 6 // _rev: '34-f8a1ea58b78974bb0c530dd9e366cf24', 7 // name: 'git-stats', 8 // description: 'Local git statistics including GitHub-like contributions calendars.', 9 // 'dist-tags': { latest: '2.9.2' }, 10 // versions: {...}, 11 // readme: '[![git-stats](http://i.imgur.com/Q7TQYHx.png)](#)\n\n# `$ git-stats` [![PayPal](https://img.shields.io/badge/%24-paypal-f39c12.svg)][paypal-donations] [![Version](https://img.shields.io/npm/v/git-stats.svg)](https://www.npmjs.com/package/git-stats) [![Downloads](https://img.shields.io/npm/dt/git-stats.svg)](https://www.npmjs.com/package/git-stats) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)\n\n> Local git statistics including GitHub-like contributions calendars.\n\nI\'d be curious to see your calendar with all your commits. Ping me on Twitter ([**@IonicaBizau**](https://twitter.com/IonicaBizau)). :smile: Until then, here\'s my calendar:\n\n![](http://i.imgur.com/PpM0i3v.png)\n\n## Contents\n\n - [Installation](#installation)\n - [Usage](#usage)\n \n - [Importing and deleting commits](#importing-and-deleting-commits)\n - [Importing all the commits from GitHub and BitBucket](#importing-all-the-commits-from-github-and-bitbucket)\n - [What about the GitHub Contributions calendar?](#what-about-the-github-contributions-calendar)\n \n - [Documentation](#documentation)\n - [How to contribute](#how-to-contribute)\n\n## Installation\n\nYou can install the package globally and use it as command line tool:\n\n```sh\n# Install the package globally\nnpm i -g git-stats\n# Initialize git hooks\n# This is for tracking the new commits\ncurl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash\n```\n\nThen, run `git-stats --help` and see what the CLI tool can do.\n\n```sh\n$ git-stats --help\nUsage: git-stats [options]\n\nOptions:\n -s, --since <date> Optional start date. \n -u, --until <date> Optional end date. \n -n, --no-ansi Forces the tool not to use ANSI styles. \n -l, --light Enables the light theme. \n -a, --authors Shows a pie chart with the author related \n contributions in the current repository. \n -g, --global-activity Shows global activity calendar in the current \n repository. \n -d, --data <path> Sets a custom data store file. \n -f, --first-day <day> Sets the first day of the week. \n --record <data> Records a new commit. Don\'t use this unless you \n are a mad scientist. If you are a developer, just\n use this option as part of the module. \n -r, --raw Outputs a dump of the raw JSON data. \n -h, --help Displays this help. \n -v, --version Displays version information. \n\nExamples:\n git-stats # Default behavior (stats in the last year)\n git-stats -l # Light mode\n git-stats -s \'1 January 2012\' # All the commits from 1 January 2012 to now\n git-stats -s \'1 January 2012\' -u \'31 December 2012\' # All the commits from 2012\n\nYour commit history is kept in ~/.git-stats by default. You can create ~/.git-stats-config.json to specify different defaults.\n\nDocumentation can be found at https://github.com/IonicaBizau/git-stats\n```\n\n## Usage\n### Importing and deleting commits\n\nI know it\'s not nice to start your git commit calendar from scratch. That\'s why I created [`git-stats-importer`](https://github.com/IonicaBizau/git-stats-importer)–a tool which imports or deletes the commits from selected repositories.\n\nCheck it out here: https://github.com/IonicaBizau/git-stats-importer\n\nThe usage is simple:\n\n```sh\n# Install the importer tool\n$ npm install -g git-stats-importer\n\n# Go to the repository you want to import\n$ cd path/to/my-repository\n\n# Import the commits\n$ git-stats-importer\n\n# ...or delete them if that\'s a dummy repository\n$ git-stats-importer --delete\n```\n### Importing all the commits from GitHub and BitBucket\n\nYes, that\'s also possible. I [built a tool which downloads and then imports all the commits you have pushed to GitHub and BitBucket](https://github.com/IonicaBizau/repository-downloader)!\n\n```sh\n# Download the repository downloader\n$ git clone https://github.com/IonicaBizau/repository-downloader.git\n\n# Go to repository downloader\n$ cd repository-downloader\n\n# Install the dependencies\n$ npm install\n\n# Start downloading and importing\n$ ./start\n```\n### What about the GitHub Contributions calendar?\n\nIf you want to visualize the calendars that appear on GitHub profiles, you can do that using [`ghcal`](https://github.com/IonicaBizau/ghcal).\n\n```sh\n# Install ghcal\n$ npm install -g ghcal\n\n# Check out @alysonla\'s contributions\n$ ghcal -u alysonla\n```\n\nFor more detailed documentation, check out the repository: https://github.com/IonicaBizau/ghcal.\n\nIf want to get even more GitHub stats in your terminal, you may want to try [`github-stats`](https://github.com/IonicaBizau/github-stats)--this is like `git-stats` but with data taken from GitHub.\n\n## Using the configuration file\n\nYou can tweak the git-stats behavior using a configuration file in your home directory: `~/.git-stats-config.js`.\n\nThis file should export an object, like below (defaults are listed):\n\n```js\nmodule.exports = {\n // "DARK", "LIGHT" or an object interpreted by IonicaBizau/node-git-stats-colors\n "theme": "DARK"\n\n // The file where the commit hashes will be stored\n , "path": "~/.git-stats"\n\n // First day of the week\n , first_day: "Sun"\n\n // This defaults to *one year ago*\n // It can be any parsable date\n , since: undefined\n\n // This defaults to *now*\n // It can be any parsable date\n , until: undefined\n\n // Don\'t show authors by default\n // If true, this will enable the authors pie\n , authors: false\n\n // No global activity by default\n // If true, this will enable the global activity calendar in the current project\n , global_activity: false\n};\n```\n\nSince it\'s a js file, you can `require` any other modules there.\n\n## Cross-platform compatibility\n\n`git-stats` is working fine in terminal emulators supporting ANSI styles. It should work fine on Linux and OS X.\n\nIf you run `git-stats` to display graph on Windows, please use a terminal that can properly display ANSI colors.\n\nCygwin Terminal is known to work, while Windows Command Prompt and Git Bash do not. Improvements are more than welcome! :dizzy:\n\n## Example\n\nHere is an example how to use this package as library. To install it locally, as library, you can do that using `npm`:\n\n```sh\n$ npm i --save git-stats\n```\n\n```js\n// Dependencies\nvar GitStats = require("git-stats");\n\n// Create the GitStats instance\nvar g1 = new GitStats();\n\n// Display the ansi calendar\ng1.ansiCalendar({\n theme: "DARK"\n}, function (err, data) {\n console.log(err || data);\n});\n```\n\n## Documentation\n\nFor full API reference, see the [DOCUMENTATION.md][docs] file.\n\n## Press Highlights\n\n - [*A GitHub-like contributions calendar, but locally, with all your git commits*, The Changelog](https://changelog.com/github-like-contributions-calendar-locally-git-commits/)\n\n## How to contribute\nHave an idea? Found a bug? See [how to contribute][contributing].\n\n## Where is this library used?\nIf you are using this library in one of your projects, add it in this list. :sparkles:\n\n - [`git-stats-importer`](https://github.com/IonicaBizau/git-stats-importer)\n\n## License\n\n[MIT][license] © [Ionică Bizău][website]\n\n[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW\n[donate-now]: http://i.imgur.com/6cMbHOC.png\n\n[license]: http://showalicense.com/?fullname=Ionic%C4%83%20Biz%C4%83u%20%3Cbizauionica%40gmail.com%3E%20(http%3A%2F%2Fionicabizau.net)&year=2015#license-mit\n[website]: http://ionicabizau.net\n[contributing]: /CONTRIBUTING.md\n[docs]: /DOCUMENTATION.md', 12 // maintainers: [ { name: 'ionicabizau', email: 'bizauionica@yahoo.com' } ], 13 // time: {...}, 14 // ... 15 // users: { bret: true, despairblue: true, program247365: true }, 16 // _attachments: {} } 17}); 18 19packageJson("IonicaBizau/git-stats", function (err, data) { 20 console.log(err || data); 21 // { name: 'git-stats', 22 // version: '2.9.2', 23 // description: 'Local git statistics including GitHub-like contributions calendars.', 24 // main: 'lib/index.js', 25 // bin: { 'git-stats': './bin/git-stats' }, 26 // ... 27 // _id: 'git-stats@2.9.2' } 28}); 29 30packageJson("git@github.com:IonicaBizau/git-stats.git", function (err, data) { 31 console.log(err || data); 32 // { name: 'git-stats', 33 // version: '2.9.2', 34 // description: 'Local git statistics including GitHub-like contributions calendars.', 35 // ... 36 // _id: 'git-stats@2.9.2' } 37}); 38 39packageJson("git@github.com:IonicaBizau/git-stats.git", "2.7.0", function (err, data) { 40 console.log(err || data.version); 41 // "2.7.0" 42});
packageJson(input, version, callback)
Fetches the package.json
file contents from npm
or a git repository.
input
: The package npm
name or git url. The git urls are friendly, being parsed by git-source
.version
: The npm
package version or a git sha/tag/branch/etc.callback
: The callback function.Have an idea? Found a bug? See how to contribute.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More