1.0.1 • Published 6 years ago
@tanem/authors v1.0.1
authors
Generates a list of authors in a format suitable for inclusion in an
AUTHORSfile.
Usage
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 -nThe list of authors is printed to stdout, so can be redirected to a file:
$ authors > AUTHORSAPI
authors(options)
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
// Note: The `fs.promises` 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);
}
})();authors.sync(options)
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
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);
}Installation
$ npm install @tanem/authors --save-devLicense
MIT