Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanem/shelljs-plugin-authors
:shell: A ShellJS plugin for generating a nicely formatted list of authors.
https://github.com/tanem/shelljs-plugin-authors
authors git script shelljs shelljs-plugin shortlog
Last synced: about 2 months ago
JSON representation
:shell: A ShellJS plugin for generating a nicely formatted list of authors.
- Host: GitHub
- URL: https://github.com/tanem/shelljs-plugin-authors
- Owner: tanem
- License: mit
- Created: 2018-08-19T17:52:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-08T05:03:54.000Z (9 months ago)
- Last Synced: 2024-04-14T14:59:29.804Z (9 months ago)
- Topics: authors, git, script, shelljs, shelljs-plugin, shortlog
- Language: JavaScript
- Homepage: https://npm.im/shelljs-plugin-authors
- Size: 1.64 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# shelljs-plugin-authors
[![npm version](https://img.shields.io/npm/v/shelljs-plugin-authors.svg?style=flat-square)](https://www.npmjs.com/package/shelljs-plugin-authors)
[![build status](https://img.shields.io/github/workflow/status/tanem/shelljs-plugin-authors/CI?style=flat-square)](https://github.com/tanem/shelljs-plugin-authors/actions?query=workflow%3ACI)
[![coverage status](https://img.shields.io/codecov/c/github/tanem/shelljs-plugin-authors.svg?style=flat-square)](https://codecov.io/gh/tanem/shelljs-plugin-authors)
[![npm downloads](https://img.shields.io/npm/dm/shelljs-plugin-authors.svg?style=flat-square)](https://www.npmjs.com/package/shelljs-plugin-authors)
[![shelljs-plugin](https://img.shields.io/badge/shelljs-plugin-brightgreen.svg?style=flat-square)](https://github.com/shelljs/shelljs/wiki/Using-ShellJS-Plugins)> A [ShellJS](https://github.com/shelljs/shelljs) plugin for generating a nicely formatted list of authors.
## Usage
Let's assume that we're inside a git repo, and the output of `git shortlog -se` gives us something like:
```
24 Andrew Powlowski
39 Gregorio Heaney
55 Miller Reichel
70 Mervin Graham
99 Hallie Paucek
```We want to generate a nicely formatted list of authors sorted alphabetically by author name. There are two ways to do that with this module, first you can use it as a ShellJS plugin:
```js
const shell = require('shelljs')
require('shelljs-plugin-authors')
const authors = shell.authors()
shell.echo(authors.stdout)
/*
Andrew Powlowski
Gregorio Heaney
Miller Reichel
Mervin Graham
Hallie Paucek
*/
```Or you can use it via the CLI:
```
$ shelljs-authors
Andrew Powlowski
Gregorio Heaney
Miller Reichel
Mervin Graham
Hallie Paucek
```If you'd prefer the list be sorted by number of commits per author, pass the `-n` option:
```js
const shell = require('shelljs')
require('shelljs-plugin-authors')
const authors = shell.authors('-n')
shell.echo(authors.stdout)
/*
Hallie Paucek
Mervin Graham
Miller Reichel
Gregorio Heaney
Andrew Powlowski
*/
``````
$ shelljs-authors -n
Hallie Paucek
Mervin Graham
Miller Reichel
Gregorio Heaney
Andrew Powlowski
```## API
### Plugin
**Options**
- `-n` - _Optional_ Sort the list by number of commits per author.
**Example**
```js
shell.authors('-n')
```### CLI
```
$ shelljs-authors -hUsage: shelljs-authors [options]
Generate a nicely formatted list of authors
Options:
-V, --version output the version number
-n, --numbered Sort by number of commits per author
-h, --help output usage informationExamples:
$ shelljs-authors
$ shelljs-authors -n
```## Installation
### Plugin
```
$ npm i -D shelljs shelljs-plugin-authors
```### CLI
```
$ npm i -g shelljs shelljs-plugin-authors
```## License
MIT