Generates a list of authors in a format suitable for inclusion in an AUTHORS file.
npm install @tanem/authors



> Generates a list of authors in a format suitable for inclusion in an AUTHORS file.
``
Usage: authors [options]
Generates a list of authors in a format suitable for inclusion in an AUTHORS file.
Options:
-V, --version output the version number
-n, --numbered sort by number of commits per author
-h, --help output usage information
Examples:
$ authors
$ authors -n
`
The list of authors is printed to stdout, so can be redirected to a file:
``
$ authors > AUTHORS
Returns a Promise that will be resolved with a list of authors sorted alphabetically by author name. If an error occurs during execution, the Promise is rejected with an Error object.
Arguments
- options - _Optional_ An object containing the optional arguments defined below. Defaults to {}.isNumbered
- - _Optional_ Sort the list by number of commits per author.
Example
`tsfs.promises
// Note: The API was added in Node.js v10.0.0.
import { promises as fs } from 'fs';
import path from 'path';
import authors from '@tanem/authors';
(async () => {
try {
const result = await authors({ isNumbered: true });
await fs.writeFile(path.join(__dirname, 'AUTHORS'), result, 'utf-8');
} catch (error) {
console.error(error);
}
})();
`
Synchronously returns a list of authors sorted alphabetically by author name. If an error occurs during execution, an Error object will be thrown.
Arguments
- options - _Optional_ An object containing the optional arguments defined below. Defaults to {}.isNumbered
- - _Optional_ Sort the list by number of commits per author.
Example
`ts
import fs from 'fs';
import path from 'path';
import authors from '@tanem/authors';
try {
const result = authors.sync({ isNumbered: true });
fs.writeFileSync(path.join(__dirname, 'AUTHORS'), result, 'utf-8');
} catch (error) {
console.error(error);
}
`
```
$ npm install @tanem/authors --save-dev
MIT