{"id":20551406,"url":"https://github.com/generate/generate-readme","last_synced_at":"2025-04-14T11:20:53.706Z","repository":{"id":57246182,"uuid":"62967304","full_name":"generate/generate-readme","owner":"generate","description":"Generate a basic README.md using answers to prompts and data from the environment, like package.json. This generator can be run by command line if Generate is installed globally, or you can use this as a plugin or sub-generator in your own generator.","archived":false,"fork":false,"pushed_at":"2016-10-01T11:39:38.000Z","size":1103,"stargazers_count":28,"open_issues_count":3,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T02:03:07.786Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/generate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-09T20:13:14.000Z","updated_at":"2024-12-18T17:43:19.000Z","dependencies_parsed_at":"2022-08-24T16:10:50.639Z","dependency_job_id":null,"html_url":"https://github.com/generate/generate-readme","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-readme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-readme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-readme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fgenerate-readme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generate","download_url":"https://codeload.github.com/generate/generate-readme/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703200,"owners_count":21148118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T02:30:44.017Z","updated_at":"2025-04-14T11:20:53.650Z","avatar_url":"https://github.com/generate.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# generate-readme [![NPM version](https://img.shields.io/npm/v/generate-readme.svg?style=flat)](https://www.npmjs.com/package/generate-readme) [![NPM downloads](https://img.shields.io/npm/dm/generate-readme.svg?style=flat)](https://npmjs.org/package/generate-readme) [![Build Status](https://img.shields.io/travis/generate/generate-readme.svg?style=flat)](https://travis-ci.org/generate/generate-readme)\n\n\u003e Generate a README.md using answers to prompts and data from the environment, like `package.json`, `.git` config, etc. This generator can be run by command line if Generate is installed globally, or you can use this as a plugin or sub-generator in your own generator.\n\nNeed to generate documentation? You might also be interested in [verb](https://github.com/verbose/verb).\n\u003cbr\u003e\n![generate-readme demo](https://raw.githubusercontent.com/generate/generate-readme/master/docs/demo.gif)\n\n## Table of Contents\n\n- [What is \"Generate\"?](#what-is-generate)\n- [Command line usage](#command-line-usage)\n  * [Install](#install)\n  * [Run](#run)\n  * [Help](#help)\n  * [Options](#options)\n  * [Running tasks](#running-tasks)\n- [Available tasks](#available-tasks)\n- [Running multiple generators](#running-multiple-generators)\n  * [generate-package](#generate-package)\n  * [generate-dest](#generate-dest)\n- [API usage](#api-usage)\n  * [Install locally](#install-locally)\n  * [Use as a plugin](#use-as-a-plugin)\n  * [Register as a generator](#register-as-a-generator)\n- [Customization](#customization)\n  * [Destination directory](#destination-directory)\n  * [Overriding templates](#overriding-templates)\n- [About](#about)\n  * [Related projects](#related-projects)\n  * [Contributing](#contributing)\n  * [Running tests](#running-tests)\n  * [Author](#author)\n  * [License](#license)\n\n_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_\n\n## What is \"Generate\"?\n\nGenerate is a command line tool and developer framework for scaffolding out new GitHub projects using [generators](https://github.com/generate/generate/blob/master/docs/generators.md) and [tasks](https://github.com/generate/generate/blob/master/docs/tasks.md).\n\nAnswers to prompts and the user's environment can be used to determine the templates, directories, files and contents to build. Support for [gulp](http://gulpjs.com), [base](https://github.com/node-base/base) and [assemble](https://github.com/assemble/assemble) plugins, and much more.\n\n**For more information**:\n\n* Visit the [generate project](https://github.com/generate/generate/)\n* Visit the [generate documentation](https://github.com/generate/generate/blob/master/docs/)\n* Find [generators on npm](https://www.npmjs.com/browse/keyword/generate-generator) (help us [author generators](https://github.com/generate/generate/blob/master/docs/micro-generators.md))\n\n## Command line usage\n\n### Install\n\n**Installing the CLI**\n\nTo run the `readme` generator from the command line, you'll need to install [Generate](https://github.com/generate/generate) globally first. You can do that now with the following command:\n\n```sh\n$ npm install --global generate\n```\n\nThis adds the `gen` command to your system path, allowing it to be run from any directory.\n\n**Install generate-readme**\n\nInstall this module with the following command:\n\n```sh\n$ npm install --global generate-readme\n```\n\n### Run\n\nYou should now be able to run `generate-readme` with the following command:\n\n```sh\n$ gen readme\n```\n\n**What will happen?**\n\nRunning `$ gen readme` will run the generator's [default task](#default), which will:\n\n1. prompt you to choose a license to generate\n2. prompt you for any information that's missing, if applicable (like author name, etc.)\n3. render the necessary template(s) using your answers\n4. write the resulting file(s) to the current working directory\n\n**Conflict detection**\n\nThis generator will [prompt you for feedback](https://github.com/node-base/base-fs-conflicts) _before overwrite existing files_. You can [set the destination](#customization) to a new directory if you want to avoid the prompts, or avoid accidentally overwriting files with unintentional answers =\u003e _'Oops! I meant \"no! Don't overwrite!!!\"'_.\n\n**What you should see in the terminal**\n\nIf completed successfully, you should see both `starting` and `finished` events in the terminal, like the following:\n\n```sh\n[00:44:21] starting ...\n...\n[00:44:22] finished ✔\n```\n\nIf you do not see one or both of those events, please [let us know about it](../../issues).\n\n### Help\n\nTo see a general help menu and available commands for Generate's CLI, run:\n\n```sh\n$ gen help\n```\n\n### Options\n\n* `--dest`, `-d`: set the destination directory to use for generated files\n* `--no-hints`: Don't use hints in prompts (except for global data, like `author.name`)\n\n### Running tasks\n\nGenerators use [tasks](https://github.com/generate/generate/blob/master/docs/tasks.md) for flow control. Tasks are run by passing the name of the task to run after the generator name, delimited by a comma.\n\n**Example**\n\nFor instance, the following will run generator `foo`, task `bar`:\n\n```sh\n$ gen foo:bar\n       ^       ^\ngenerator     task\n```\n\n**Default task**\n\nWhen a task name is not explicitly passed on the command line, Generate's CLI will run the [default](#default) task.\n\n## Available tasks\n\n### [default](generator.js#L26)\n\nAlias for the [readme:node](#node) task, to allow this generator to be run with the following command:\n\n**Example**\n\n```sh\n$ gen readme\n$ gen readme --dest ./docs\n```\n\n### [node](generator.js#L41)\n\nGenerate a basic `README.md` for a node.js project to the current working directory or specified `--dest`.\n\n**Example**\n\n```sh\n$ gen readme:node\n$ gen readme:node --dest ./docs\n```\n\n### [min](generator.js#L57)\n\nGenerate a minimal `README.md` to the current working directory or specified `--dest`. Also aliased as `readme-minimal` to provide a semantic task name for plugin usage.\n\n**Example**\n\n```sh\n$ gen readme:min\n```\n\nVisit Generate's [documentation for tasks](https://github.com/generate/generate/blob/master/docs/tasks.md).\n\n## Running multiple generators\n\nGenerate supports running multiple generators at once. The following generator(s) work well with `generate-readme`:\n\n### generate-package\n\nRun [generate-package](https://github.com/generate/generate-package) **before** `generate-readme` to create a `package.json` for your project. Answers to your prompts will be used in `generate-readme`, so you will only be prompted for anything that hasn't already been answered.\n\n```sh\n$ gen package readme\n```\n\n**Example**\n\n![generate-readme generate-dest example](https://raw.githubusercontent.com/generate/generate-readme/master/docs/demo-package.gif)\n\n### generate-dest\n\nRun [generate-dest](https://github.com/generate/generate-dest) **before** `generate-readme` to prompt for the destination directory to use for generated files.\n\n```sh\n$ gen dest readme\n```\n\n**Example**\n\n![generate-readme generate-dest example](https://raw.githubusercontent.com/generate/generate-readme/master/docs/demo-dest.gif)\n\n## API usage\n\nUse `generate-readme` as a [plugin](https://github.com/generate/generate/blob/master/docs/plugins.md) in your own [generator](https://github.com/generate/generate/blob/master/docs/generators.md).\n\n### Install locally\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save generate-readme\n```\n\n### Use as a plugin\n\nWhen used as a plugin, tasks from `generate-readme` are added to your generator's instance.\n\n```js\nmodule.exports = function(app) {\n  app.use(require('generate-readme'));\n  // do generator stuff\n};\n```\n\n**Running tasks**\n\nYou can now run any tasks from `generate-readme` as if they were part of your own generator.\n\n```js\nmodule.exports = function(app) {\n  app.use(require('generate-readme'));\n\n  app.task('foo', function(cb) {\n    // do task stuff\n    cb();\n  });\n\n  // run the `mit` task from `generate-readme`\n  app.task('default', ['foo', 'mit']);\n};\n```\n\n### Register as a generator\n\nWhen registered as a generator, tasks from `generate-readme` are added to the \"namespace\" you give to the generator.\n\n```js\nmodule.exports = function(app) {\n  app.register('foo', require('generate-readme'));\n  // generate\n};\n```\n\n**Running tasks**\n\nPass the names of one or more tasks to run to the `.generate` method, prefixed with the namespace of the sub-generator (`foo`, in our example):\n\n**Examples**\n\nRun the `bar` task from generator `foo`:\n\n```js\nmodule.exports = function(app) {\n  app.register('foo', require('generate-readme'));\n\n  app.generate('foo:bar', function(err) {\n    if (err) console.log(err);\n  });\n};\n```\n\nWrap the call to `.generate` in a task, so it can be run on demand:\n\n```js\nmodule.exports = function(app) {\n  app.register('foo', require('generate-readme'));\n\n  app.task('bar', function(cb) {\n    app.generate('foo:bar', cb);\n  });\n};\n```\n\n**More information**\n\nVisit the [generator docs](https://github.com/generate/generate/blob/master/docs/generators.md) to learn more about creating, installing, using and publishing generators.\n\n## Customization\n\nThe following instructions can be used to override settings in `generate-readme`. Visit the [Generate documentation](https://github.com/generate/generate/blob/master/docs/overriding-defaults.md) to learn about other ways to override defaults.\n\n### Destination directory\n\nTo customize the destination directory, install [generate-dest](https://github.com/generate/generate-dest) globally, then in the command line prefix `dest` before any other generator names.\n\nFor example, the following will prompt you for the destination path to use, then pass the result to `generate-readme`:\n\n```sh\n$ gen dest readme\n```\n\n### Overriding templates\n\nYou can override a template by adding a template of the same name to the `templates` directory in user home.\n\nFor example, to override the `foo.tmpl` template, add a template at the following path `~/generate/templates/foo.tmpl`, where `~/` is the user-home directory that `os.homedir()` resolves to on your system.\n\n## About\n\n### Related projects\n\n* [generate-gitignore](https://www.npmjs.com/package/generate-gitignore): Generate any local or global .gitignore file from the github/gitignore repository. Use from the command… [more](https://github.com/generate/generate-gitignore) | [homepage](https://github.com/generate/generate-gitignore \"Generate any local or global .gitignore file from the github/gitignore repository. Use from the command line when Generate's CLI is installed globally, or use as a plugin or sub-generator in your own generator.\")\n* [generate-license](https://www.npmjs.com/package/generate-license): Generate a license file for a GitHub project. | [homepage](https://github.com/generate/generate-license \"Generate a license file for a GitHub project.\")\n* [generate-package](https://www.npmjs.com/package/generate-package): Generate a package.json from a pre-defined or user-defined template. This generator can be used from… [more](https://github.com/generate/generate-package) | [homepage](https://github.com/generate/generate-package \"Generate a package.json from a pre-defined or user-defined template. This generator can be used from the command line when globally installed, or as a plugin or sub-generator in your own generator.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm install -d \u0026\u0026 npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT license](https://github.com/generate/generate-readme/blob/master/LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 01, 2016._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerate%2Fgenerate-readme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenerate%2Fgenerate-readme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerate%2Fgenerate-readme/lists"}