Common scripts for my projects.
npm install tanem-scripts



> Common scripts for my projects.
``
Usage: tanem-scripts [options] [command]
Common scripts for my projects.
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
authors generates a list of authors in a format suitable for inclusion in an AUTHORS file
changelog [options] generates a changelog using GitHub tags and pull requests
release runs npm-version with a valid semver.inc argument
`
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.
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-scripts';
(async () => {
try {
const result = await authors();
await fs.writeFile(path.join(__dirname, 'AUTHORS'), result, 'utf-8');
} catch (error) {
console.error(error);
}
})();
`
---
Returns a Promise that will be resolved with the changelog. 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 {}.futureRelease
- - _Optional_ Tag to use for PRs merged since the last published tag. If unspecified, those PRs will be excluded.
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 { changelog } from 'tanem-scripts';
(async () => {
try {
const result = await changelog({
futureRelease: 'v2.0.0',
});
await fs.writeFile(path.join(__dirname, 'CHANGELOG.md'), result, 'utf-8');
} catch (error) {
console.error(error);
}
})();
`
---
Returns a Promise that will be resolved once the release script completes. If an error occurs during execution, the Promise is rejected with an Error object.
Example
`ts
import { release } from 'tanem-scripts';
(async () => {
try {
await release();
} catch (error) {
console.error(error);
}
})();
`
``
$ npm install tanem-scripts --save-dev
You'll also need to generate a new GitHub personal access token, then set an environment variable by running the following command at the prompt or by adding it to your shell profile:
`sh``
export CHANGELOG_GITHUB_TOKEN=
MIT