Skip to content

Instantly share code, notes, and snippets.

@calebklc
Forked from nicejade/README.md
Created March 19, 2020 15:23
Show Gist options
  • Select an option

  • Save calebklc/a1e1d2f8341068a5cac4a6b4e6a20f21 to your computer and use it in GitHub Desktop.

Select an option

Save calebklc/a1e1d2f8341068a5cac4a6b4e6a20f21 to your computer and use it in GitHub Desktop.
Generate a good README

Generate a good README

Generate a good README use `npx` commmd.

Goal and Philosophy

Generate a good README use npx commmd.

Prerequisites

You Need install or upgrade Node.js (>= 8.*, Npm version >= 5.2.0).

Usage

npx https://gist.github.com/nicejade/406f154e882a836de1b2e12d02b84aab

License

MIT

Copyright (c) 2019-present, nicejade.

#!/usr/bin/env node
const fs = require('fs')
const README_STR = `
<p align="center">
<a href="https://arya.lovejade.cn/" target="_blank">
<img width="100"src="https://raw.githubusercontent.com/nicejade/arya-jarvis/master/assets/images/logo.png">
</a>
</p>
<h1 align="center">Your Project Name</h1>
<div align="center">
<strong>
Description, Let people know what your project can do specifically.
</strong>
</div>
<br>
<div align="center">
<a href="https://nodejs.org/en/">
<img src="https://img.shields.io/badge/node-%3E%3D%208.0.0-green.svg" alt="Node Version">
</a>
<a href="https://nicelinks.site/post/5c16083e819ae45de1453caa">
<img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat" alt="Prettier">
</a>
</div>
## Goal and Philosophy
Write your original intention, philosophy, and goals for the project what you design. A short description of the motivation behind the creation and maintenance of the project. This should explain why the project exists.
## Prerequisites
Explain some prerequisites that users need to prepare before installation and use, such as:
You Need install or upgrade [Node.js](https://nodejs.org/en/) (>= `8.*`, Npm version >= `5.2.0`, [Yarn](https://www.jeffjade.com/2017/12/30/135-npm-vs-yarn-detial-memo/) preferred).
## Installation
\`\`\`bash
npm i
\`\`\`
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance.
## Usage
\`\`\`bash
npm start
\`\`\`
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Screenshots (Optional)
Include logo/demo screenshot etc.
## Support (Optional)
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Tests (Optional)
Describe and show how to run the tests with code examples.
## Roadmap (Optional)
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing (Optional)
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
## Authors and acknowledgment (Optional)
Show your appreciation to those who have contributed to the project.
## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) #DATE#-present, [your-name](your-homepage).
## Project status (Optional)
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
`
const readmeStr = README_STR.replace('#DATE#', new Date().getFullYear())
const savedPath = process.cwd() + '/README.md'
fs.writeFile(savedPath, readmeStr, err => {
if (err) return console.error(err)
console.log('✔️ README.md has been successfully generated for you.')
})
{
"name": "generate-good-readme",
"version": "1.0.0",
"bin": "./index.js"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment