[
  {
    "path": ".eslintrc.js",
    "content": "module.exports = {\n  root: true,\n  env: {\n    node: true,\n    jest: true\n  },\n  extends: ['airbnb-base', 'eslint:recommended'],\n  rules: {\n    semi: ['error', 'never'],\n    'no-use-before-define': ['error', { functions: false }],\n    'comma-dangle': 0,\n    'no-var': 2,\n    'prefer-const': 2,\n    'operator-linebreak': 0,\n    'no-confusing-arrow': 0,\n    'implicit-arrow-linebreak': 0,\n    indent: 0,\n    'no-param-reassign': 0,\n    'function-paren-newline': 0,\n    'arrow-parens': 0\n  },\n  parserOptions: {\n    parser: 'babel-eslint'\n  }\n}\n"
  },
  {
    "path": ".github/CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contribute to creating a positive environment include:\n\n- Using welcoming and inclusive language\n- Being respectful of differing viewpoints and experiences\n- Gracefully accepting constructive criticism\n- Focusing on what is best for the community\n- Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n- The use of sexualized language or imagery and unwelcome sexual attention or advances\n- Trolling, insulting/derogatory comments, and personal or political attacks\n- Public or private harassment\n- Publishing others' private information, such as a physical or electronic address, without explicit permission\n- Other conduct which could reasonably be considered inappropriate in a professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at abgrallkefran@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]\n\n[homepage]: http://contributor-covenant.org\n[version]: http://contributor-covenant.org/version/1/4/\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: [kefranabg]\npatreon: FranckAbgrall\nopen_collective: # Replace with a single Open Collective username\nko_fi: # Replace with a single Ko-fi username\ntidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\ncommunity_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry\nliberapay: # Replace with a single Liberapay username\nissuehunt: # Replace with a single IssueHunt username\notechie: # Replace with a single Otechie username\ncustom: # Replace with a single custom sponsorship URL\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Desktop (please complete the following information):**\n\n- OS: [e.g. iOS]\n- Browser [e.g. chrome, safari]\n- Version [e.g. 22]\n\n**Smartphone (please complete the following information):**\n\n- Device: [e.g. iPhone6]\n- OS: [e.g. iOS8.1]\n- Browser [e.g. stock browser, safari]\n- Version [e.g. 22]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/workflows/nodejs.yml",
    "content": "name: Node CI\n\non:\n  pull_request:\n  push:\n    branches:\n      - master\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    strategy:\n      matrix:\n        node-version: [8.x, 10.x, 12.x]\n\n    steps:\n      - uses: actions/checkout@v1\n      - uses: actions/cache@v1\n        with:\n          path: ~/.npm\n          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}\n          restore-keys: |\n            ${{ runner.os }}-node-\n      - name: Install dependencies\n        run: npm ci\n      - name: Run prettier check on project files\n        run: npm run prettier:check\n      - name: Run linter\n        run: npm run lint\n      - name: Run unit tests\n        run: npm run test:ci\n        env:\n          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\nnode_modules\n/report\n/coverage\n\n# Log files\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Editor directories and files\n.idea\n*.suo\n*.ntvs*\n*.njsproj\n*.sln\n*.sw*\n\n# Fix an error from npm 6.9.0\n.git\n"
  },
  {
    "path": ".prettierignore",
    "content": "templates/*"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"singleQuote\": true,\n  \"semi\": false\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n  \"editor.formatOnSave\": true\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\n<a name=\"1.0.0\"></a>\n\n## 1.0.0 (2019-12-03)\n\n### Added\n\n- ✨ Ask for package manager when is JS project [[29986ce](https://github.com/kefranabg/readme-md-generator/commit/29986cea9acde108b9e167db5d0def67beaf7384)]\n- ✨ Ask user for a link to contributing guide (fixes [#168](https://github.com/kefranabg/readme-md-generator/issues/168)) ([#179](https://github.com/kefranabg/readme-md-generator/issues/179)) [[310a8b1](https://github.com/kefranabg/readme-md-generator/commit/310a8b1f78154d9226c1267ccf18d0db9d9ea09f)]\n- ✨ Ask author's linkedin username (fixes [#170](https://github.com/kefranabg/readme-md-generator/issues/170)) ([#177](https://github.com/kefranabg/readme-md-generator/issues/177)) [[10954d1](https://github.com/kefranabg/readme-md-generator/commit/10954d10739b995c431b751d63d5624c17397235)]\n\n### Changed\n\n- ⬆️ Update yargs to the latest version ([#186](https://github.com/kefranabg/readme-md-generator/issues/186)) [[16d7ceb](https://github.com/kefranabg/readme-md-generator/commit/16d7ceb8ec3040d63841397ded83dbdddc28da52)]\n- ⬆️ Update ejs to the latest version ([#187](https://github.com/kefranabg/readme-md-generator/issues/187)) [[139e906](https://github.com/kefranabg/readme-md-generator/commit/139e906b1ed1b875ca96869fe8570ca03d9806c2)]\n- 🔧 Update CI tiggers ([#184](https://github.com/kefranabg/readme-md-generator/issues/184)) [[6ef2be8](https://github.com/kefranabg/readme-md-generator/commit/6ef2be8ba8e00af16087f42eabd7e4b4ed2243b3)]\n- ⬆️ Update ora to the latest version ([#181](https://github.com/kefranabg/readme-md-generator/issues/181)) [[c563d9d](https://github.com/kefranabg/readme-md-generator/commit/c563d9d473e5c17be6a45936b2f58f83b734c4e9)]\n- 🔧 Move CI from CircleCI to GitHub actions [[a132525](https://github.com/kefranabg/readme-md-generator/commit/a132525ffe343629db2589378647665747e5cd4f)]\n- 🔧 Update FUNDING.yml [[83be6c0](https://github.com/kefranabg/readme-md-generator/commit/83be6c00842eb4321b5c37a7f5617e28f1548cdb)]\n\n### Fixed\n\n- 🐛 Fix version badge label when contains \\_ or - ([#190](https://github.com/kefranabg/readme-md-generator/issues/190)) [[6c345b5](https://github.com/kefranabg/readme-md-generator/commit/6c345b50caec810ef48f00dcbac0255f1db1f4a3)]\n- 🐛 Execute default function to get default answer when -y flag is passed ([#185](https://github.com/kefranabg/readme-md-generator/issues/185)) [[89cd82d](https://github.com/kefranabg/readme-md-generator/commit/89cd82db18655bbb085eb72c339402f412dd3996)]\n- 🐛 Escape markdown characters in social network questions answers ([#183](https://github.com/kefranabg/readme-md-generator/issues/183)) [[d96e310](https://github.com/kefranabg/readme-md-generator/commit/d96e310c5b54c573a139d01f4ad348f9456f7c3c)]\n- ✏️ Use gender neutral in comment ([#174](https://github.com/kefranabg/readme-md-generator/issues/174)) [[9f78778](https://github.com/kefranabg/readme-md-generator/commit/9f78778002410c0b82f36015b86443fb366425a7)]\n- 🐛 Fix InstallCommand test name [[279711f](https://github.com/kefranabg/readme-md-generator/commit/279711f1cdd18b2d53478c52f577041ea2186675)]\n\n### Miscellaneous\n\n- 📝 Add open collective to readme ([#192](https://github.com/kefranabg/readme-md-generator/issues/192)) [[81e3873](https://github.com/kefranabg/readme-md-generator/commit/81e387357c5c088714291b0a7f18b66cab8cd5c6)]\n- 📝 Add anku255 as a contributor for test and bug ([#182](https://github.com/kefranabg/readme-md-generator/issues/182)) [[7624889](https://github.com/kefranabg/readme-md-generator/commit/76248890cf46ec7a27b6986add3d156095deb782)]\n\n<a name=\"0.7.0\"></a>\n\n## 0.7.0 (2019-11-01)\n\n### Added\n\n- ✨ Add Author Github website url if exists (fixes [#124](https://github.com/kefranabg/readme-md-generator/issues/124)) ([#145](https://github.com/kefranabg/readme-md-generator/issues/145)) [[541d6e5](https://github.com/kefranabg/readme-md-generator/commit/541d6e53fdc2df42a3a416b5c2f2b5c1422e45db)]\n\n### Changed\n\n- ♻️ re-use prettier regexp across scripts ([#159](https://github.com/kefranabg/readme-md-generator/issues/159)) [[576e367](https://github.com/kefranabg/readme-md-generator/commit/576e367c67f7fbe0013fe2e32e20d17b6d4b8c8f)]\n- 🔧 Add prettier fix command ([#158](https://github.com/kefranabg/readme-md-generator/issues/158)) [[da2c700](https://github.com/kefranabg/readme-md-generator/commit/da2c70034165b42d8e25abf1c799f275d7c349b0)]\n\n### Fixed\n\n- 🐛 Don't suggest install default value when project is not a js project ([#169](https://github.com/kefranabg/readme-md-generator/issues/169)) [[672d591](https://github.com/kefranabg/readme-md-generator/commit/672d591ae845e95ef2b8f41b00997e09dfff1a3c)]\n- 🐛 Fix static badge generation when license name contains special characters ([#141](https://github.com/kefranabg/readme-md-generator/issues/141)) [[5b8bc08](https://github.com/kefranabg/readme-md-generator/commit/5b8bc08925e54f1c542d84a26283832040232053)]\n\n### Miscellaneous\n\n- 📝 Update README with CONTRIBUTING link [[5ec2ce4](https://github.com/kefranabg/readme-md-generator/commit/5ec2ce4e1404349eb94037dae16a8c569977e90a)]\n- 📝 Add CONTRIBUTING.md (fixes [#155](https://github.com/kefranabg/readme-md-generator/issues/155)) ([#160](https://github.com/kefranabg/readme-md-generator/issues/160)) [[f2d6020](https://github.com/kefranabg/readme-md-generator/commit/f2d6020e5fdef4c880ed6830302ca20f0817d192)]\n- 📝 Add code of conduct markdown ([#157](https://github.com/kefranabg/readme-md-generator/issues/157)) [[be3ec22](https://github.com/kefranabg/readme-md-generator/commit/be3ec22a7d44c88b59c3c67910ad266b65ff9746)]\n\n<a name=\"0.6.4\"></a>\n\n## 0.6.4 (2019-10-09)\n\n### Added\n\n- ✨ Add check for overwrite readme ([#143](https://github.com/kefranabg/readme-md-generator/issues/143)) [[2e12553](https://github.com/kefranabg/readme-md-generator/commit/2e12553df31c65f31c88f556eb8811d5b5672739)]\n- ✨ Display license badge even when there is no license url ([#139](https://github.com/kefranabg/readme-md-generator/issues/139)) [[a60627c](https://github.com/kefranabg/readme-md-generator/commit/a60627c93af35a2f87bc2f7ed44ce702871a6f7d)]\n- ✨ Ask for demo link during README creation process ([#102](https://github.com/kefranabg/readme-md-generator/issues/102)) ([#130](https://github.com/kefranabg/readme-md-generator/issues/130)) [[f4d6ad4](https://github.com/kefranabg/readme-md-generator/commit/f4d6ad45c3884b24bf60536dd02d3ae17034f1b1)]\n- ✨ Add dynamic license badge ([#131](https://github.com/kefranabg/readme-md-generator/issues/131)) [[86bdac5](https://github.com/kefranabg/readme-md-generator/commit/86bdac57c35734ca0bdd252d3e0ae12f9a5e80c8)]\n\n### Changed\n\n- ⬆️ Fix vulnerabilities ([#136](https://github.com/kefranabg/readme-md-generator/issues/136)) [[fb96985](https://github.com/kefranabg/readme-md-generator/commit/fb96985ff9665319f3669deae3e14e31a4fe9df9)]\n\n<a name=\"0.6.3\"></a>\n\n## 0.6.3 (2019-09-24)\n\n### Added\n\n- ✨ Update issue templates [[3d5c28b](https://github.com/kefranabg/readme-md-generator/commit/3d5c28b3eb57c18245ef22f47fa8083117f1a08f)]\n- ✨ Add link to npm on version badge ([#99](https://github.com/kefranabg/readme-md-generator/issues/99)) [[fdfe6e3](https://github.com/kefranabg/readme-md-generator/commit/fdfe6e374953a255eb72945405e8d8eadb62d3a9)]\n- ✨ Add dynamic version badge if package exists on NPM ([#94](https://github.com/kefranabg/readme-md-generator/issues/94)) [[0a11d2a](https://github.com/kefranabg/readme-md-generator/commit/0a11d2ae3a7ea767e4f0138f7b1d21e114fb991a)]\n\n### Changed\n\n- ⬆️ Update ora to the latest version ([#122](https://github.com/kefranabg/readme-md-generator/issues/122)) [[ffb4d11](https://github.com/kefranabg/readme-md-generator/commit/ffb4d111547c23cedf03168c2facbd285c3c7d9d)]\n- 🔧 Add gh package registry config ([#115](https://github.com/kefranabg/readme-md-generator/issues/115)) [[af1fb5a](https://github.com/kefranabg/readme-md-generator/commit/af1fb5ac10cfdabc57fc579e3c0a8f9a3d417f64)]\n- ⬆️ Upgrade date-fns version ([#113](https://github.com/kefranabg/readme-md-generator/issues/113)) [[eacad62](https://github.com/kefranabg/readme-md-generator/commit/eacad62792e0f95f41b7ed267611265e08b14c2b)]\n- ⬆️ Upgrade inquirer to the latest version 🚀 ([#110](https://github.com/kefranabg/readme-md-generator/issues/110)) [[f6fc84e](https://github.com/kefranabg/readme-md-generator/commit/f6fc84ec71a5b11de581745c8d75b7e6c1dd2143)]\n- ⬆️ Bump mixin-deep from 1.3.1 to 1.3.2 ([#112](https://github.com/kefranabg/readme-md-generator/issues/112)) [[4e0abc4](https://github.com/kefranabg/readme-md-generator/commit/4e0abc4b574ced8433c0cc48f965d959a100ff04)]\n- ⬆️ Bump eslint-utils from 1.3.1 to 1.4.2 ([#111](https://github.com/kefranabg/readme-md-generator/issues/111)) [[f0e09ac](https://github.com/kefranabg/readme-md-generator/commit/f0e09ac3f6b20882bda39c67e552eedd6fe18dce)]\n- 🎨 Format Github issue templates [[95f44d2](https://github.com/kefranabg/readme-md-generator/commit/95f44d26062b06439c1ff97a13f61642279d32c5)]\n- ⬆️ Update yargs to the latest version ([#104](https://github.com/kefranabg/readme-md-generator/issues/104)) [[d66db07](https://github.com/kefranabg/readme-md-generator/commit/d66db07cd2e0393b5ecb456ee982953a1448eff4)]\n- ⬆️ Update inquirer to 6.5.1 ([#101](https://github.com/kefranabg/readme-md-generator/issues/101)) [[af8fbe6](https://github.com/kefranabg/readme-md-generator/commit/af8fbe6acf5f08090d6958e12e09c3a1f3e345ff)]\n- ⬆️ Update eslint-config-airbnb-base to 14.0.0 ([#100](https://github.com/kefranabg/readme-md-generator/issues/100)) [[85ffea5](https://github.com/kefranabg/readme-md-generator/commit/85ffea57f3b4ed925ffe827f4194ac066298eb83)]\n- ⬆️ Bump lodash from 4.17.11 to 4.17.13 ([#98](https://github.com/kefranabg/readme-md-generator/issues/98)) [[99dc774](https://github.com/kefranabg/readme-md-generator/commit/99dc774fac253a0786b935deb258a8cb3a777176)]\n- 🔧 Ignore .git file in order to fix an npm bug [[f940f13](https://github.com/kefranabg/readme-md-generator/commit/f940f130efef5ffdeb3f278e7435570c95363acb)]\n\n### Fixed\n\n- 🐛 Process get stuck because of ora new version ([#152](https://github.com/kefranabg/readme-md-generator/issues/152)) [[4a741b9](https://github.com/kefranabg/readme-md-generator/commit/4a741b9b266ae33c8c04267e6958c26e598655b7)]\n- 🐛 Fix badge target link ([#126](https://github.com/kefranabg/readme-md-generator/issues/126)) [[45df9a4](https://github.com/kefranabg/readme-md-generator/commit/45df9a4ab55ffa2ff6e8ac5a33e49bbba0b41efa)]\n- ✏️ Capitalize the H in GitHub ([#116](https://github.com/kefranabg/readme-md-generator/issues/116)) [[3d08a76](https://github.com/kefranabg/readme-md-generator/commit/3d08a7610723a0034607bd4d136926220f431a03)]\n\n### Miscellaneous\n\n- 📝 Add anku255 as a contributor ([#144](https://github.com/kefranabg/readme-md-generator/issues/144)) [[32af6a2](https://github.com/kefranabg/readme-md-generator/commit/32af6a23fd22efbc93861c47f13c190c0800b9ed)]\n- 📝 Add LucasProcopio as a contributor ([#138](https://github.com/kefranabg/readme-md-generator/issues/138)) [[d67b012](https://github.com/kefranabg/readme-md-generator/commit/d67b012fef502e296963c54f5cf3140a723c477d)]\n- 📝 Add tbetous as a contributor ([#137](https://github.com/kefranabg/readme-md-generator/issues/137)) [[a93cd56](https://github.com/kefranabg/readme-md-generator/commit/a93cd56c43ed420245824542e808e3b27654c3ec)]\n- 📝 Add david-dasilva as a contributor ([#133](https://github.com/kefranabg/readme-md-generator/issues/133)) [[f6f24e0](https://github.com/kefranabg/readme-md-generator/commit/f6f24e0be239214c5ff03d439aeb18007a513217)]\n- 📝 All contributor profile url fixed ([#129](https://github.com/kefranabg/readme-md-generator/issues/129)) [[06bd6f3](https://github.com/kefranabg/readme-md-generator/commit/06bd6f3bf9b8af68c2548bf57524e52939cd192f)]\n- 📝 Add Kushagra as a contributor ([#127](https://github.com/kefranabg/readme-md-generator/issues/127)) [[1624878](https://github.com/kefranabg/readme-md-generator/commit/1624878c90dc2f62cf5f692aa4fdedfc1d338f9c)]\n- :spakles: Add start script ([#121](https://github.com/kefranabg/readme-md-generator/issues/121)) [[bc3d383](https://github.com/kefranabg/readme-md-generator/commit/bc3d38301c5b09f301a75094d5aed6c85e130da6)]\n- 📝 Add bdougie as a contributor ([#117](https://github.com/kefranabg/readme-md-generator/issues/117)) [[2f327f7](https://github.com/kefranabg/readme-md-generator/commit/2f327f7547472093a030ded760508c90c1f21910)]\n\n<a name=\"0.5.2\"></a>\n\n## 0.5.2 (2019-07-08)\n\n### Added\n\n- ✨ Filter social network inputs to remove potential @ ([#93](https://github.com/kefranabg/readme-md-generator/issues/93)) [[ccae357](https://github.com/kefranabg/readme-md-generator/commit/ccae357ad2c8a3788a248075644cf27d312f226b)]\n\n### Miscellaneous\n\n- Update readme and contributors to reflect username change ([#91](https://github.com/kefranabg/readme-md-generator/issues/91)) [[b2be60e](https://github.com/kefranabg/readme-md-generator/commit/b2be60e8bb429c9c440c6602f4f4ebec51b6d889)]\n\n<a name=\"0.5.1\"></a>\n\n## 0.5.1 (2019-07-05)\n\n### Fixed\n\n- 🐛 Prevent encoding utf-8 chars in README ([#88](https://github.com/kefranabg/readme-md-generator/issues/88)) [[8059756](https://github.com/kefranabg/readme-md-generator/commit/80597564e0fd9e0b8c69c333929d02e9ec9ae0b0)]\n\n<a name=\"0.5.0\"></a>\n\n## 0.5.0 (2019-06-27)\n\n### Added\n\n- ✨ Allow user to choose a non HTML README template ([#80](https://github.com/kefranabg/readme-md-generator/issues/80)) [[6d5c884](https://github.com/kefranabg/readme-md-generator/commit/6d5c8848c476fc2770204f215ddd6f48d539b4e0)]\n- ✨ Allow user to specify path to custom README template ([#68](https://github.com/kefranabg/readme-md-generator/issues/68)) [[e0d66c0](https://github.com/kefranabg/readme-md-generator/commit/e0d66c002c8108ff3ae142979a5c8003a28a8107)]\n- ✨ Get author name from package.json even if author prop is an object ([#75](https://github.com/kefranabg/readme-md-generator/issues/75)) [[688c338](https://github.com/kefranabg/readme-md-generator/commit/688c33833188a5487ff6df024d4993404ee0406c)]\n\n### Changed\n\n- ⬆️ Update eslint to the latest version ([#70](https://github.com/kefranabg/readme-md-generator/issues/70)) [[88c96ac](https://github.com/kefranabg/readme-md-generator/commit/88c96ac31acfa12381a33d39a2953f3405053870)]\n- ⬆️ Update inquirer to the latest version ([#67](https://github.com/kefranabg/readme-md-generator/issues/67)) [[59f69e5](https://github.com/kefranabg/readme-md-generator/commit/59f69e51ec1caae17230d9331a2c14b04bd2825e)]\n- ♻️ Refactoring inquirer code ([#69](https://github.com/kefranabg/readme-md-generator/issues/69)) [[802d57d](https://github.com/kefranabg/readme-md-generator/commit/802d57d8af2e2cdcdbddea86c2fa2225db6d4516)]\n\n<a name=\"0.4.0\"></a>\n\n## 0.4.0 (2019-06-20)\n\n### Added\n\n- ✨ Ask for Patreon username ([#58](https://github.com/kefranabg/readme-md-generator/issues/58)) [[59b57af](https://github.com/kefranabg/readme-md-generator/commit/59b57af7aa5ce91ff0ce1998bff835d781b5df79)]\n- ✨ Enable funding [[af10690](https://github.com/kefranabg/readme-md-generator/commit/af10690857df92d29807a37abce055d5351f99f4)]\n- ✨ Add -v alias for --version option ([#50](https://github.com/kefranabg/readme-md-generator/issues/50)) [[a30cf02](https://github.com/kefranabg/readme-md-generator/commit/a30cf02531a4d26e85ed5e9db9ada6262d478711)]\n\n### Fixed\n\n- 🐛 Prevent from using inquirer 6.4 [[688c754](https://github.com/kefranabg/readme-md-generator/commit/688c754584bfb7d9191eb30e18563e16f2a7b3ff)]\n\n### Miscellaneous\n\n- 👥 Add contributors [[2533cd8](https://github.com/kefranabg/readme-md-generator/commit/2533cd8f2c8c78a043e67ca2bead9b4606606121)]\n- docs: add kefranabg as a contributor ([#57](https://github.com/kefranabg/readme-md-generator/issues/57)) [[e5d9d53](https://github.com/kefranabg/readme-md-generator/commit/e5d9d5376b8341e06005e497728935c2874631b6)]\n- 📝 Update README [[0dff1e5](https://github.com/kefranabg/readme-md-generator/commit/0dff1e5562404559b2ad64ccf0c8fc3d1df73f92)]\n- 📝 Replace static version badge by a dynamic one [[99a507d](https://github.com/kefranabg/readme-md-generator/commit/99a507d6ebf54b58aaf941e1752e7e4d16565a53)]\n- 📝 Update doc to use npx ([#55](https://github.com/kefranabg/readme-md-generator/issues/55)) [[77d6fdc](https://github.com/kefranabg/readme-md-generator/commit/77d6fdc4f0a2d9b86d3169f35ed8eab355ebcd68)]\n- 📝 Update badge list on README [[e87ed1a](https://github.com/kefranabg/readme-md-generator/commit/e87ed1ae92f04cc94e06a3e6339090588b3eaa17)]\n- 📝 Add available options in README ([#49](https://github.com/kefranabg/readme-md-generator/issues/49)) [[93da519](https://github.com/kefranabg/readme-md-generator/commit/93da51958d04335674201490cb90b9f04f5551bb)]\n\n<a name=\"0.3.0\"></a>\n\n## 0.3.0 (2019-06-15)\n\n### Added\n\n- ✨ Add --yes flag ([#45](https://github.com/kefranabg/readme-md-generator/issues/45)) [[f0e2bd6](https://github.com/kefranabg/readme-md-generator/commit/f0e2bd6aaa0ed7b47843482046d4c443db5643c7)]\n- ✨ Add prerequisites badges ([#38](https://github.com/kefranabg/readme-md-generator/issues/38)) [[e7e3590](https://github.com/kefranabg/readme-md-generator/commit/e7e3590023027f80acde722aa91824d9bc3d0b26)]\n- ✅ Add missing test to readme generation [[d5027e4](https://github.com/kefranabg/readme-md-generator/commit/d5027e4d0e0d31e9059729e208e20908b299f040)]\n- ✨ Add Twitter follow badge ([#35](https://github.com/kefranabg/readme-md-generator/issues/35)) [[58034a0](https://github.com/kefranabg/readme-md-generator/commit/58034a00bfdf6ea50e4ffabdd39657dfce317fee)]\n- ✨ Improve README template [[7a12c8a](https://github.com/kefranabg/readme-md-generator/commit/7a12c8a687f50da7fee1c2b2352363f3abf1e71f)]\n- ✨ Improve README content [[ffd6e1f](https://github.com/kefranabg/readme-md-generator/commit/ffd6e1f9653c31168bf025e797e05951bc9ab15a)]\n- ✨ Adding some commands [[6850244](https://github.com/kefranabg/readme-md-generator/commit/685024493f8670559df643b551f383b9cbf434b0)]\n- 🔊 Add logs in writeReadme [[772d536](https://github.com/kefranabg/readme-md-generator/commit/772d536a99fea4d0a8024fedb02664ae3a968351)]\n- ✨ Add homepage link if exist [[1c1bf08](https://github.com/kefranabg/readme-md-generator/commit/1c1bf08b29ef16a677114d74eb145d3a83f3c35a)]\n\n### Changed\n\n- 💄 change prerequisite badges color ([#43](https://github.com/kefranabg/readme-md-generator/issues/43)) [[e888726](https://github.com/kefranabg/readme-md-generator/commit/e888726b471a28265ed689786f85c8618b9af957)]\n- 🔧 Move some dependencies in devDependencies [[0038201](https://github.com/kefranabg/readme-md-generator/commit/0038201ec94f1d31b3473948cdfd9f950466d4ad)]\n- 💬 Update badge version in README [[e5d418c](https://github.com/kefranabg/readme-md-generator/commit/e5d418c2b3b7e6fcbb2e5631adb70b51c2b82843)]\n\n### Fixed\n\n- 🐛 Fix current working directory error ([#46](https://github.com/kefranabg/readme-md-generator/issues/46)) [[6c184ba](https://github.com/kefranabg/readme-md-generator/commit/6c184ba009cfafb25adb1ff7ba6e1c4570de7503)]\n- 🐛 Fix error when package.json does not exist ([#42](https://github.com/kefranabg/readme-md-generator/issues/42)) [[fe0fc61](https://github.com/kefranabg/readme-md-generator/commit/fe0fc61e4664baf457e1d6f4a35e50e8cd325c10)]\n- ✏️ Remove whitespace before punctuation marks ([#36](https://github.com/kefranabg/readme-md-generator/issues/36)) [[094f9fb](https://github.com/kefranabg/readme-md-generator/commit/094f9fb5e7ebe6cc9001d1fe54cd9be0362730bd)]\n- 🐛 Get doc url from only if github repos [[62109c4](https://github.com/kefranabg/readme-md-generator/commit/62109c4b315613100b7adf9b9714b5a7e6c00b31)]\n\n<a name=\"0.1.4\"></a>\n\n## 0.1.4 (2019-06-11)\n\n### Added\n\n- ✨ Add instruction in README [[8f32674](https://github.com/kefranabg/readme-md-generator/commit/8f3267442fbd1673e9c13969858c2075864d8be6)]\n- ✅ Add missing test for cli [[cdd7df6](https://github.com/kefranabg/readme-md-generator/commit/cdd7df640401fbce044c0e042bc02a8ede09b818)]\n- ✨ Improve README content [[9bb7e90](https://github.com/kefranabg/readme-md-generator/commit/9bb7e909d838bc6ae364f8ca40115adda590a9c4)]\n- ✅ Add cli tests [[2c5ed1e](https://github.com/kefranabg/readme-md-generator/commit/2c5ed1e1fb249f4f10e6ec7b304b1df1fbb38ec7)]\n- ✅ Add tests for project infos module [[aae1bc6](https://github.com/kefranabg/readme-md-generator/commit/aae1bc6872a60feb2cfd6e50057be857f6a87db8)]\n- ✨ Improve README content [[34d475c](https://github.com/kefranabg/readme-md-generator/commit/34d475cf4d446317430587d5b50644cf18049975)]\n- ✅ Add tests for questions [[576a290](https://github.com/kefranabg/readme-md-generator/commit/576a290f77cab6376c50d9edf3d6c51e572988af)]\n- ✅ Add tests for readme file [[0e18c2e](https://github.com/kefranabg/readme-md-generator/commit/0e18c2e73a16fb0edc039e3d28de52691c9409df)]\n- ✨ Enable code cov ([#23](https://github.com/kefranabg/readme-md-generator/issues/23)) [[46d21b5](https://github.com/kefranabg/readme-md-generator/commit/46d21b5df0f26cba8f9d3eb42492a129d3dc4dd1)]\n- ✨ Add log infos during process [[912c602](https://github.com/kefranabg/readme-md-generator/commit/912c602c9022ebcfd84f66ffce96ab814f424cd7)]\n- ✨ Improve README [[a8ff226](https://github.com/kefranabg/readme-md-generator/commit/a8ff22685daac89d22ac1756b480a2f6777d0f50)]\n- ✨ Improve README [[83796b2](https://github.com/kefranabg/readme-md-generator/commit/83796b29d055a52b9c7a67f9e9405141972b236c)]\n- ✨ Add some badges [[3174ab9](https://github.com/kefranabg/readme-md-generator/commit/3174ab9830b47919559a2c4cdc73b4a598b9e9d9)]\n- ✨ Add documentation badge [[dd435ca](https://github.com/kefranabg/readme-md-generator/commit/dd435ca85d2d5fa00b8cd28d956b6ff8ce08ea1f)]\n- ✨ Add license url and name auto detection [[d2ee432](https://github.com/kefranabg/readme-md-generator/commit/d2ee432d5cd09b163efcfccf7e37354754eb589b)]\n- ✨ Add prerequisites section in README [[9924f72](https://github.com/kefranabg/readme-md-generator/commit/9924f723afacee5c03fddd6b0436edf207cd618f)]\n- ✨ Add npm version infos [[9ce8bb6](https://github.com/kefranabg/readme-md-generator/commit/9ce8bb64924404f01f2e5a0105b3241b15be1d65)]\n- ✨ Add default value for github username if repos is github [[a59520f](https://github.com/kefranabg/readme-md-generator/commit/a59520ffd877cc0a091343d764733d058f6862c1)]\n- ✨ Add contributing section [[d0f61f9](https://github.com/kefranabg/readme-md-generator/commit/d0f61f93f25998c2020f14e77165f0990cf43fb4)]\n- ✨ Improve README content [[01134d2](https://github.com/kefranabg/readme-md-generator/commit/01134d2b9d8f347335dc132b1c9ea1edddc1aac4)]\n- ✨ Improve README content [[5c4c2e8](https://github.com/kefranabg/readme-md-generator/commit/5c4c2e804429e75f912cd45c0192a990d1287a3e)]\n- ✨ Improve README content [[0b4fe40](https://github.com/kefranabg/readme-md-generator/commit/0b4fe40281f447132011a3326847e6b6829d08ac)]\n- ✨ Improve support section in README [[91a6f9e](https://github.com/kefranabg/readme-md-generator/commit/91a6f9e785a51cfdbc945b759216ef5e1708d682)]\n- ✨ Add license to README [[096d44f](https://github.com/kefranabg/readme-md-generator/commit/096d44fc89108fb91ec51b2d10a6a71fdb274ae5)]\n- ✨ Renaming questions function names [[8907db0](https://github.com/kefranabg/readme-md-generator/commit/8907db008882dd5b7a76864e59452ee5e7b9e5d7)]\n- ✨ Add Greenkeeper 🌴 [[f69b4ad](https://github.com/kefranabg/readme-md-generator/commit/f69b4adc5307be9492dc4ea370696cd84ebf8d53)]\n- ✨ Add support section in README [[b16af00](https://github.com/kefranabg/readme-md-generator/commit/b16af00df801992cdd56df54cbb8a913279ab544)]\n- ✨ Add footer in README [[3d2cd7d](https://github.com/kefranabg/readme-md-generator/commit/3d2cd7d2d0d6c737d18b3e68b8e19ef40d316e4f)]\n- ✨ Update README.md [[699f250](https://github.com/kefranabg/readme-md-generator/commit/699f250223ddd8d11872e3e3023056b15740d3ea)]\n- ✨ Add author information in README [[2337d6b](https://github.com/kefranabg/readme-md-generator/commit/2337d6b6a8a933bbb55d4ab6489999dc2fb74363)]\n- ✨ Improve author infos logic [[5d4cf6f](https://github.com/kefranabg/readme-md-generator/commit/5d4cf6fe9f790d4d2ee6bcc151e8283c7ac06655)]\n- ✨ Add author information in README [[665303a](https://github.com/kefranabg/readme-md-generator/commit/665303a623f359d819872faae4e432cb95e82a8c)]\n- 🎉 Initial commit [[500b2e8](https://github.com/kefranabg/readme-md-generator/commit/500b2e81875aeb61f94b6202bcb5d0b264cf7413)]\n\n### Changed\n\n- 🎨 Improve README structure [[1ced8d6](https://github.com/kefranabg/readme-md-generator/commit/1ced8d6ff426f5806d110f2c92b653547187c6c5)]\n- 💬 Fix README format [[20005b6](https://github.com/kefranabg/readme-md-generator/commit/20005b6d243d26a8ab8d049e722776218796bb82)]\n- 🔧 Update jest config [[3a9d847](https://github.com/kefranabg/readme-md-generator/commit/3a9d84742423d9da5b1c3c19dc96a1846010a44d)]\n- 🔧 Add jest config [[5f629ed](https://github.com/kefranabg/readme-md-generator/commit/5f629edd4bb0f9d2eb7b6e7749a92454468c08a3)]\n- ♻️ Code refactoring [[79cfbbf](https://github.com/kefranabg/readme-md-generator/commit/79cfbbf7e6cc5eefb6cd1f2a1a6809f4a9c9c593)]\n- ♻️ CLI refactoring [[ead151b](https://github.com/kefranabg/readme-md-generator/commit/ead151b9a7c2e177cd9859fb3691c530f09ded3c)]\n- ♻️ Code refactoring [[1ae6c40](https://github.com/kefranabg/readme-md-generator/commit/1ae6c40fb89f9099f0dc38e5bb843d2719d23b07)]\n- 💬 Rename command in README [[4279e2e](https://github.com/kefranabg/readme-md-generator/commit/4279e2e99e9e21a58104632478be612f9f80dbf8)]\n- 💬 Update project name [[2cad8e3](https://github.com/kefranabg/readme-md-generator/commit/2cad8e3cfca8afc33585f0de5e11378add9dad26)]\n- 🔧 Add bin config [[56d7e78](https://github.com/kefranabg/readme-md-generator/commit/56d7e7840a48f8d6d653db00538303a2dac07a77)]\n- 💬 Improve questions text [[67d611b](https://github.com/kefranabg/readme-md-generator/commit/67d611b4ba9489bdf2297e2ba120eddee0368a7a)]\n- ♻️ Utils code refactoring [[97d675e](https://github.com/kefranabg/readme-md-generator/commit/97d675efb088139949cf57e1bc0c8d534f41b136)]\n- ♻️ Code refactoring [[c14974c](https://github.com/kefranabg/readme-md-generator/commit/c14974c5b24e370c4af54ca1a7d71375eeb2bfc2)]\n- 🎨 Improve README title [[8c79b5e](https://github.com/kefranabg/readme-md-generator/commit/8c79b5efbd5e8b94497b00164642796ce0b29033)]\n- 🎨 Improve support section in README [[e855e38](https://github.com/kefranabg/readme-md-generator/commit/e855e385e0c3a8304e7e42cde4162c392269d787)]\n- 💬 Update project description and README footer texts [[b1c9a87](https://github.com/kefranabg/readme-md-generator/commit/b1c9a877874b5dd925e072d84cc8e8f8cd856bab)]\n- 🎨 Improve template format [[d27649f](https://github.com/kefranabg/readme-md-generator/commit/d27649f1a0a3f6344c74a735040436010dec86b8)]\n- ♻️ Questions and utils code refactoring [[a5b5a4c](https://github.com/kefranabg/readme-md-generator/commit/a5b5a4c95da8643af319299448d93db0123fafa1)]\n- ♻️ Questions and utils functions refactoring [[177c086](https://github.com/kefranabg/readme-md-generator/commit/177c08699989328d5ceeb71c139b196f58bd23c0)]\n- 🚨 Fix file format with prettier [[aa6e3eb](https://github.com/kefranabg/readme-md-generator/commit/aa6e3eb6081cdc0d34c872c078f3a9e415a45d2b)]\n\n### Removed\n\n- 🔥 Remove unused export [[bdc0e3e](https://github.com/kefranabg/readme-md-generator/commit/bdc0e3eb4d2d37240715abb1703eedcbe0dc5e2a)]\n\n### Fixed\n\n- 🐛 Fix badge bad link [[d8c8e45](https://github.com/kefranabg/readme-md-generator/commit/d8c8e45e77f8f5f8c68b60c176da09808e4cbb4c)]\n- 🐛 Fix bug when engines infos were not found [[918140e](https://github.com/kefranabg/readme-md-generator/commit/918140e6ad98f01279b5b2b617d4976b330faecd)]\n- 🐛 Fix badges links [[acd0a22](https://github.com/kefranabg/readme-md-generator/commit/acd0a22b9885501503d298ed125942b043884c82)]\n- 🐛 Fix badge display [[623afd9](https://github.com/kefranabg/readme-md-generator/commit/623afd9cc1831e144bcdf1ba0c0d0fc4c75c9324)]\n- 🐛 Fix author infos [[2d8b2c2](https://github.com/kefranabg/readme-md-generator/commit/2d8b2c25096fbc05ac1a24aadfd68e93899782e3)]\n\n### Miscellaneous\n\n- 0.1.4 [[65ddd76](https://github.com/kefranabg/readme-md-generator/commit/65ddd767df2712ca39527a4a30dbbcffa00be87a)]\n- 📝 Add demo to README [[19f04e2](https://github.com/kefranabg/readme-md-generator/commit/19f04e232f9363d72b9c0c5e7c8c7f4ab363528d)]\n- Merge pull request [#20](https://github.com/kefranabg/readme-md-generator/issues/20) from kefranabg/greenkeeper/initial [[acfa940](https://github.com/kefranabg/readme-md-generator/commit/acfa9407c90edd2eff549f1d21a48b3add60428a)]\n- docs(readme): add Greenkeeper badge [[d3ad805](https://github.com/kefranabg/readme-md-generator/commit/d3ad80571868c75e84de42cad13f3af64582bf8f)]\n- 📝 Update project description [[6fadc05](https://github.com/kefranabg/readme-md-generator/commit/6fadc05bffd78dfa9855578ce4af708950dc7c4c)]\n- Update README [[ee6f44f](https://github.com/kefranabg/readme-md-generator/commit/ee6f44f49ef29dba8163898a36f24efc656f762c)]\n- docs(readme): add Greenkeeper badge [[1d6fe09](https://github.com/kefranabg/readme-md-generator/commit/1d6fe09fd824be7489c10978a228acac287360da)]\n- Initial commit [[dd97da0](https://github.com/kefranabg/readme-md-generator/commit/dd97da0e0a4540806ec83152b586dd0b8f8421a1)]\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to Readme Markdown Generator\n\n👍🎉 First off, thanks for taking the time to contribute! 🎉👍\n\nWhen contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.\nPlease note we have a [code of conduct](https://github.com/kefranabg/readme-md-generator/blob/master/.github/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.\n\n## Table of Contents\n\n- [Setting Up the project locally](#setting-up-the-project-locally)\n- [Submitting a Pull Request](#submitting-a-pull-request)\n\n## Setting Up the project locally\n\nTo install the project you need to have `node` and `npm`\n\n1.  [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone\n    your fork:\n\n    ```sh\n    # Clone your fork\n    git clone https://github.com/<your-username>/readme-md-generator.git\n\n    # Navigate to the newly cloned directory\n    cd readme-md-generator\n    ```\n\n2.  Your environment needs to be running `node` version >= 9.3.0 and `npm` version >= 5.5.0.\n\n3.  from the root of the project: `npm` to install all dependencies\n\n    - make sure you have latest `npm` version\n\n4.  from the root of the project: `npm start` to run the cli.\n\n> Tip: Keep your `master` branch pointing at the original repository and make\n> pull requests from branches on your fork. To do this, run:\n>\n> ```sh\n> git remote add upstream https://github.com/kefranabg/readme-md-generator.git\n> git fetch upstream\n> git branch --set-upstream-to=upstream/master master\n> ```\n>\n> This will add the original repository as a \"remote\" called \"upstream,\" then\n> fetch the git information from that remote, then set your local `master`\n> branch to use the upstream master branch whenever you run `git pull`. Then you\n> can make all of your pull request branches based on this `master` branch.\n> Whenever you want to update your version of `master`, do a regular `git pull`.\n\n## Submitting a Pull Request\n\nPlease go through existing issues and pull requests to check if somebody else is already working on it.\n\nAlso, make sure to run the tests and lint the code before you commit your\nchanges.\n\n```sh\nnpm run test\nnpm run lint\n```\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Franck Abgrall\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "<h1 align=\"center\">Welcome to readme-md-generator 👋</h1>\n<p align=\"center\">\n  <img src=\"https://img.shields.io/npm/v/readme-md-generator.svg?orange=blue\" />\n  <a href=\"https://www.npmjs.com/package/readme-md-generator\">\n    <img alt=\"downloads\" src=\"https://img.shields.io/npm/dm/readme-md-generator.svg?color=blue\" target=\"_blank\" />\n  </a>\n  <a href=\"https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE\">\n    <img alt=\"License: MIT\" src=\"https://img.shields.io/badge/license-MIT-yellow.svg\" target=\"_blank\" />\n  </a>\n  <a href=\"https://codecov.io/gh/kefranabg/readme-md-generator\">\n    <img src=\"https://codecov.io/gh/kefranabg/readme-md-generator/branch/master/graph/badge.svg\" />\n  </a>\n  <a href=\"https://github.com/frinyvonnick/gitmoji-changelog\">\n    <img src=\"https://img.shields.io/badge/changelog-gitmoji-brightgreen.svg\" alt=\"gitmoji-changelog\">\n  </a>\n  <a href=\"https://twitter.com/FranckAbgrall\">\n    <img alt=\"Twitter: FranckAbgrall\" src=\"https://img.shields.io/twitter/follow/FranckAbgrall.svg?style=social\" target=\"_blank\" />\n  </a>\n</p>\n\n> CLI that generates beautiful README.md files.<br /> `readme-md-generator` will suggest you default answers by reading your `package.json` and `git` configuration.\n\n## ✨ Demo\n\n`readme-md-generator` is able to read your environment (package.json, git config...) to suggest you default answers during the `README.md` creation process:\n\n<p align=\"center\">\n  <img width=\"700\" align=\"center\" src=\"https://user-images.githubusercontent.com/9840435/60266022-72a82400-98e7-11e9-9958-f9004c2f97e1.gif\" alt=\"demo\"/>\n</p>\n\nGenerated `README.md`:\n\n<p align=\"center\">\n  <img width=\"700\" src=\"https://user-images.githubusercontent.com/9840435/60266090-9cf9e180-98e7-11e9-9cac-3afeec349bbc.jpg\" alt=\"cli output\"/>\n</p>\n\nExample of `package.json` with good meta data:\n\n```json\n// The package.json is not required to run README-MD-GENERATOR\n{\n  \"name\": \"readme-md-generator\",\n  \"version\": \"0.1.3\",\n  \"description\": \"CLI that generates beautiful README.md files.\",\n  \"author\": \"Franck Abgrall\",\n  \"license\": \"MIT\",\n  \"homepage\": \"https://github.com/kefranabg/readme-md-generator#readme\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/kefranabg/readme-md-generator.git\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/kefranabg/readme-md-generator/issues\"\n  },\n  \"engines\": {\n    \"npm\": \">=5.5.0\",\n    \"node\": \">=9.3.0\"\n  }\n}\n```\n\n## 🚀 Usage\n\nMake sure you have [npx](https://www.npmjs.com/package/npx) installed (`npx` is shipped by default since npm `5.2.0`)\n\nJust run the following command at the root of your project and answer questions:\n\n```sh\nnpx readme-md-generator\n```\n\nOr use default values for all questions (`-y`):\n\n```sh\nnpx readme-md-generator -y\n```\n\nUse your own `ejs` README template (`-p`):\n\n```sh\nnpx readme-md-generator -p path/to/my/own/template.md\n```\n\nYou can find [ejs README template examples here](https://github.com/kefranabg/readme-md-generator/tree/master/templates).\n\n## Code Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n<a href=\"https://github.com/kefranabg/readme-md-generator/graphs/contributors\"><img src=\"https://opencollective.com/readme-md-generator/contributors.svg?width=890&button=false\" /></a>\n\n## Financial Contributors\n\nBecome a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/readme-md-generator/contribute)]\n\n### Individuals\n\n<a href=\"https://opencollective.com/readme-md-generator\"><img src=\"https://opencollective.com/readme-md-generator/individuals.svg?width=890\"></a>\n\n### Organizations\n\nSupport this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/readme-md-generator/contribute)]\n<a href=\"https://opencollective.com/readme-md-generator/organization/0/website\"><img src=\"https://opencollective.com/readme-md-generator/organization/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/readme-md-generator/organization/1/website\"><img src=\"https://opencollective.com/readme-md-generator/organization/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/readme-md-generator/organization/2/website\"><img src=\"https://opencollective.com/readme-md-generator/organization/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/readme-md-generator/organization/3/website\"><img src=\"https://opencollective.com/readme-md-generator/organization/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/readme-md-generator/organization/4/website\"><img src=\"https://opencollective.com/readme-md-generator/organization/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/readme-md-generator/organization/5/website\"><img src=\"https://opencollective.com/readme-md-generator/organization/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/readme-md-generator/organization/6/website\"><img src=\"https://opencollective.com/readme-md-generator/organization/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/readme-md-generator/organization/7/website\"><img src=\"https://opencollective.com/readme-md-generator/organization/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/readme-md-generator/organization/8/website\"><img src=\"https://opencollective.com/readme-md-generator/organization/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/readme-md-generator/organization/9/website\"><img src=\"https://opencollective.com/readme-md-generator/organization/9/avatar.svg\"></a>\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome.<br />\nFeel free to check [issues page](https://github.com/kefranabg/readme-md-generator/issues) if you want to contribute.<br />\n[Check the contributing guide](./CONTRIBUTING.md).<br />\n\n## Author\n\n👤 **Franck Abgrall**\n\n- Twitter: [@FranckAbgrall](https://twitter.com/FranckAbgrall)\n- Github: [@kefranabg](https://github.com/kefranabg)\n\n## Show your support\n\nPlease ⭐️ this repository if this project helped you!\n\n<a href=\"https://www.patreon.com/FranckAbgrall\">\n  <img src=\"https://c5.patreon.com/external/logo/become_a_patron_button@2x.png\" width=\"160\">\n</a>\n\n## 📝 License\n\nCopyright © 2019 [Franck Abgrall](https://github.com/kefranabg).<br />\nThis project is [MIT](https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE) licensed.\n\n---\n\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_\n"
  },
  {
    "path": "jest.config.js",
    "content": "module.exports = {\n  collectCoverageFrom: [\n    './src/**/*.js',\n    '!./src/index.js',\n    '!**/node_modules/**',\n    '!**/vendor/**'\n  ]\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"readme-md-generator\",\n  \"version\": \"1.0.0\",\n  \"description\": \"CLI that generates beautiful README.md files.\",\n  \"main\": \"src/index.js\",\n  \"bin\": {\n    \"readme\": \"src/index.js\"\n  },\n  \"dependencies\": {\n    \"boxen\": \"^4.0.0\",\n    \"date-fns\": \"^2.0.1\",\n    \"ejs\": \"^3.0.1\",\n    \"git-repo-name\": \"^1.0.1\",\n    \"inquirer\": \"~7.0.0\",\n    \"load-json-file\": \"^6.0.0\",\n    \"lodash\": \"^4.17.11\",\n    \"markdown-escape\": \"^1.0.2\",\n    \"node-fetch\": \"^2.6.0\",\n    \"ora\": \"4.0.3\",\n    \"yargs\": \"^15.0.1\"\n  },\n  \"devDependencies\": {\n    \"codecov\": \"^3.5.0\",\n    \"eslint\": \"^6.0.0\",\n    \"eslint-config-airbnb-base\": \"^14.0.0\",\n    \"eslint-plugin-import\": \"^2.17.3\",\n    \"jest\": \"^24.8.0\",\n    \"prettier\": \"^1.17.1\"\n  },\n  \"scripts\": {\n    \"lint\": \"eslint src\",\n    \"prettier\": \"prettier \\\"**/*.{js,md,json}\\\"\",\n    \"prettier:check\": \"npm run prettier -- --check\",\n    \"prettier:fix\": \"npm run prettier -- --write\",\n    \"start\": \"node src/index.js\",\n    \"test\": \"jest\",\n    \"test:ci\": \"jest --coverage && codecov\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/kefranabg/readme-md-generator.git\"\n  },\n  \"keywords\": [\n    \"readme\",\n    \"md\",\n    \"cli\",\n    \"generator\",\n    \"template\"\n  ],\n  \"author\": \"Franck Abgrall\",\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/kefranabg/readme-md-generator/issues\"\n  },\n  \"homepage\": \"https://github.com/kefranabg/readme-md-generator#readme\",\n  \"publishConfig\": {\n    \"registry\": \"https://npm.pkg.github.com/@kefranabg\"\n  },\n  \"engines\": {\n    \"npm\": \">=5.5.0\",\n    \"node\": \">=9.3.0\"\n  }\n}\n"
  },
  {
    "path": "src/__snapshots__/readme.spec.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`readme buildReadmeContent should return readme default template content 1`] = `\n\"<h1 align=\\\\\"center\\\\\">Welcome to readme-md-generator 👋</h1>\n<p>\n  <a href=\\\\\"https://www.npmjs.com/package/readme-md-generator\\\\\" target=\\\\\"_blank\\\\\">\n    <img alt=\\\\\"Version\\\\\" src=\\\\\"https://img.shields.io/npm/v/readme-md-generator.svg\\\\\">\n  </a>\n  <img src=\\\\\"https://img.shields.io/badge/npm-%3E%3D5.5.0-blue.svg\\\\\" />\n  <img src=\\\\\"https://img.shields.io/badge/node-%3E%3D%209.3.0-blue.svg\\\\\" />\n  <a href=\\\\\"https://github.com/kefranabg/readme-md-generator#readme\\\\\" target=\\\\\"_blank\\\\\">\n    <img alt=\\\\\"Documentation\\\\\" src=\\\\\"https://img.shields.io/badge/documentation-yes-brightgreen.svg\\\\\" />\n  </a>\n  <a href=\\\\\"https://github.com/kefranabg/readme-md-generator/graphs/commit-activity\\\\\" target=\\\\\"_blank\\\\\">\n    <img alt=\\\\\"Maintenance\\\\\" src=\\\\\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\\\\\" />\n  </a>\n  <a href=\\\\\"https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE\\\\\" target=\\\\\"_blank\\\\\">\n    <img alt=\\\\\"License: MIT\\\\\" src=\\\\\"https://img.shields.io/github/license/kefranabg/readme-md-generator\\\\\" />\n  </a>\n  <a href=\\\\\"https://twitter.com/FranckAbgrall\\\\\" target=\\\\\"_blank\\\\\">\n    <img alt=\\\\\"Twitter: FranckAbgrall\\\\\" src=\\\\\"https://img.shields.io/twitter/follow/FranckAbgrall.svg?style=social\\\\\" />\n  </a>\n</p>\n\n> Generates beautiful README files from git config &amp; package.json infos\n\n### 🏠 [Homepage](https://github.com/kefranabg/readme-md-generator#readme)\n\n### ✨ [Demo](https://github.com/kefranabg/readme-md-generator#-demo)\n\n## Prerequisites\n\n- npm &gt;=5.5.0\n- node &gt;= 9.3.0\n\n## Install\n\n\\`\\`\\`sh\nnpm install\n\\`\\`\\`\n\n## Usage\n\n\\`\\`\\`sh\nnpm start\n\\`\\`\\`\n\n## Run tests\n\n\\`\\`\\`sh\nnpm run test\n\\`\\`\\`\n\n## Author\n\n👤 **Franck Abgrall**\n\n* Website: https://www.franck-abgrall.me/\n* Twitter: [@FranckAbgrall](https://twitter.com/FranckAbgrall)\n* GitHub: [@kefranabg](https://github.com/kefranabg)\n* LinkedIn: [@franckabgrall](https://linkedin.com/in/franckabgrall)\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/kefranabg/readme-md-generator/issues). You can also take a look at the [contributing guide](https://github.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md).\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n<a href=\\\\\"https://www.patreon.com/FranckAbgrall\\\\\">\n  <img src=\\\\\"https://c5.patreon.com/external/logo/become_a_patron_button@2x.png\\\\\" width=\\\\\"160\\\\\">\n</a>\n\n## 📝 License\n\nCopyright © 2019 [Franck Abgrall](https://github.com/kefranabg).<br />\nThis project is [MIT](https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE) licensed.\n\n***\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_\"\n`;\n\nexports[`readme buildReadmeContent should return readme default template no html content 1`] = `\n\"# Welcome to readme-md-generator 👋\n[![Version](https://img.shields.io/npm/v/readme-md-generator.svg)](https://www.npmjs.com/package/readme-md-generator)\n![Prerequisite](https://img.shields.io/badge/npm-%3E%3D5.5.0-blue.svg)\n![Prerequisite](https://img.shields.io/badge/node-%3E%3D%209.3.0-blue.svg)\n[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](https://github.com/kefranabg/readme-md-generator#readme)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/kefranabg/readme-md-generator/graphs/commit-activity)\n[![License: MIT](https://img.shields.io/github/license/kefranabg/readme-md-generator)](https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE)\n[![Twitter: FranckAbgrall](https://img.shields.io/twitter/follow/FranckAbgrall.svg?style=social)](https://twitter.com/FranckAbgrall)\n\n> Generates beautiful README files from git config &amp; package.json infos\n\n### 🏠 [Homepage](https://github.com/kefranabg/readme-md-generator#readme)\n\n### ✨ [Demo](https://github.com/kefranabg/readme-md-generator#-demo)\n\n## Prerequisites\n\n- npm &gt;=5.5.0\n- node &gt;= 9.3.0\n\n## Install\n\n\\`\\`\\`sh\nnpm install\n\\`\\`\\`\n\n## Usage\n\n\\`\\`\\`sh\nnpm start\n\\`\\`\\`\n\n## Run tests\n\n\\`\\`\\`sh\nnpm run test\n\\`\\`\\`\n\n## Author\n\n👤 **Franck Abgrall**\n\n* Website: https://www.franck-abgrall.me/\n* Twitter: [@FranckAbgrall](https://twitter.com/FranckAbgrall)\n* GitHub: [@kefranabg](https://github.com/kefranabg)\n* LinkedIn: [@franckabgrall](https://linkedin.com/in/franckabgrall)\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\n\nFeel free to check [issues page](https://github.com/kefranabg/readme-md-generator/issues). You can also take a look at the [contributing guide](https://github.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md).\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n[![support us](https://img.shields.io/badge/become-a patreon%20us-orange.svg?cacheSeconds=2592000)](https://www.patreon.com/FranckAbgrall)\n\n\n## 📝 License\n\nCopyright © 2019 [Franck Abgrall](https://github.com/kefranabg).\n\nThis project is [MIT](https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE) licensed.\n\n***\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_\"\n`;\n"
  },
  {
    "path": "src/ask-overwrite.js",
    "content": "const inquirer = require('inquirer')\n\nconst question = {\n  type: 'list',\n  message:\n    '🚨  readme-md-generator will overwrite your current README.md. Are you sure you want to continue? ',\n  name: 'overwriteReadme',\n  choices: [\n    {\n      name: 'No',\n      value: false\n    },\n    {\n      name: 'Yes ',\n      value: true\n    }\n  ]\n}\n\n/**\n * Ask users if they want to overwrite the existing README\n */\nmodule.exports = async () => {\n  const { overwriteReadme } = await inquirer.prompt([question])\n  return overwriteReadme\n}\n"
  },
  {
    "path": "src/ask-overwrite.spec.js",
    "content": "const inquirer = require('inquirer')\n\nconst askOverwrite = require('./ask-overwrite')\n\nconst expectedQuestion = {\n  type: 'list',\n  message:\n    '🚨  readme-md-generator will overwrite your current README.md. Are you sure you want to continue? ',\n  name: 'overwriteReadme',\n  choices: [\n    {\n      name: 'No',\n      value: false\n    },\n    {\n      name: 'Yes ',\n      value: true\n    }\n  ]\n}\n\ninquirer.prompt = jest.fn(items =>\n  Promise.resolve(\n    items.reduce((result, item) => {\n      result[item.name] = 'value'\n      return result\n    }, {})\n  )\n)\n\ndescribe('ask-overwrite', () => {\n  beforeEach(() => {\n    inquirer.prompt.mockClear()\n  })\n\n  it('should call prompt right questions', async () => {\n    await askOverwrite()\n    expect(inquirer.prompt).toHaveBeenCalledWith([expectedQuestion])\n  })\n\n  it('should return the right value', async () => {\n    expect(await askOverwrite()).toEqual('value')\n  })\n})\n"
  },
  {
    "path": "src/ask-questions.js",
    "content": "const inquirer = require('inquirer')\nconst { flatMap } = require('lodash')\n\nconst questionsBuilders = require('./questions')\nconst utils = require('./utils')\n\n/**\n * Ask user questions and return context to generate a README\n *\n * @param {Object} projectInfos\n * @param {Boolean} useDefaultAnswers\n */\nmodule.exports = async (projectInfos, useDefaultAnswers) => {\n  const questions = flatMap(Object.values(questionsBuilders), questionBuilder =>\n    questionBuilder(projectInfos)\n  )\n\n  const answersContext = useDefaultAnswers\n    ? await utils.getDefaultAnswers(questions)\n    : await inquirer.prompt(questions)\n\n  return {\n    isGithubRepos: projectInfos.isGithubRepos,\n    repositoryUrl: projectInfos.repositoryUrl,\n    projectPrerequisites: undefined,\n    isProjectOnNpm: utils.isProjectAvailableOnNpm(answersContext.projectName),\n    ...answersContext\n  }\n}\n"
  },
  {
    "path": "src/ask-questions.spec.js",
    "content": "const inquirer = require('inquirer')\n\nconst questions = require('./questions')\nconst askQuestions = require('./ask-questions')\n\ninquirer.prompt = jest.fn(items =>\n  Promise.resolve(\n    items.reduce((result, item) => {\n      result[item.name] = 'value'\n      return result\n    }, {})\n  )\n)\n\njest.mock('./questions', () => ({\n  askProjectName: jest.fn(() => ({\n    name: 'projectName',\n    type: 'input',\n    default: 'defaultProjectName'\n  })),\n  askProjectVersion: jest.fn(() => ({\n    name: 'projectVersion',\n    type: 'input'\n  })),\n  askProjectDescription: jest.fn(() => ({\n    name: 'projectDescription',\n    type: 'checkbox',\n    choices: [\n      { value: { name: 'choiceOne', value: 1 }, checked: true },\n      { value: { name: 'choiceTwo', value: 2 }, checked: false }\n    ]\n  }))\n}))\n\ndescribe('ask-questions', () => {\n  beforeEach(() => {\n    inquirer.prompt.mockClear()\n  })\n\n  it('should call all builder functions exported by questions', async () => {\n    const projectInfos = { name: 'readme-md-generator' }\n\n    await askQuestions(projectInfos, false)\n\n    expect(questions.askProjectName).toHaveBeenCalledTimes(1)\n    expect(questions.askProjectVersion).toHaveBeenCalledTimes(1)\n    expect(questions.askProjectDescription).toHaveBeenCalledTimes(1)\n  })\n\n  it('should use default values with --yes option', async () => {\n    const result = await askQuestions({}, true)\n\n    expect(inquirer.prompt).not.toHaveBeenCalled()\n    expect(result).toEqual({\n      projectName: 'defaultProjectName',\n      projectVersion: '',\n      projectDescription: [{ name: 'choiceOne', value: 1 }],\n      isGithubRepos: undefined,\n      repositoryUrl: undefined,\n      projectPrerequisites: undefined,\n      isProjectOnNpm: false\n    })\n  })\n\n  it('should return merged contexts', async () => {\n    const projectInfos = { name: 'readme-md-generator' }\n\n    const context = await askQuestions(projectInfos, false)\n\n    expect(context).toEqual({\n      projectName: 'value',\n      projectVersion: 'value',\n      projectDescription: 'value',\n      isGithubRepos: undefined,\n      repositoryUrl: undefined,\n      projectPrerequisites: undefined,\n      isProjectOnNpm: true\n    })\n  })\n})\n"
  },
  {
    "path": "src/choose-template.js",
    "content": "const inquirer = require('inquirer')\nconst path = require('path')\n\nmodule.exports = async useDefaultAnswers => {\n  const defaultTemplate = path.resolve(__dirname, '../templates/default.md')\n  const defaultNoHtmlTemplate = path.resolve(\n    __dirname,\n    '../templates/default-no-html.md'\n  )\n\n  if (useDefaultAnswers) return defaultTemplate\n\n  const question = {\n    type: 'list',\n    message:\n      '🎨  Use HTML in your README.md for a nicer rendering? (not supported everywhere. ex: Bitbucket)',\n    name: 'templatePath',\n    choices: [\n      {\n        name: 'Yes ',\n        value: defaultTemplate\n      },\n      {\n        name: 'No',\n        value: defaultNoHtmlTemplate\n      }\n    ]\n  }\n\n  const { templatePath } = await inquirer.prompt([question])\n\n  return templatePath\n}\n"
  },
  {
    "path": "src/choose-template.spec.js",
    "content": "const inquirer = require('inquirer')\nconst path = require('path')\n\nconst chooseTemplate = require('./choose-template')\n\nconst defaultTemplatePath = path.resolve(__dirname, '../templates/default.md')\nconst defaultNoHtmlTemplatePath = path.resolve(\n  __dirname,\n  '../templates/default-no-html.md'\n)\n\ninquirer.prompt = jest.fn(() =>\n  Promise.resolve({ templatePath: defaultTemplatePath })\n)\n\ndescribe('choose-template', () => {\n  it('should return user choice', async () => {\n    const result = await chooseTemplate(false)\n\n    expect(result).toEqual(defaultTemplatePath)\n  })\n\n  it('should return default template', async () => {\n    const result = await chooseTemplate(true)\n\n    expect(result).toEqual(defaultTemplatePath)\n  })\n\n  it('should call prompt with correct parameters', async () => {\n    await chooseTemplate(false)\n\n    expect(inquirer.prompt).toHaveBeenNthCalledWith(1, [\n      {\n        type: 'list',\n        message:\n          '🎨  Use HTML in your README.md for a nicer rendering? (not supported everywhere. ex: Bitbucket)',\n        name: 'templatePath',\n        choices: [\n          {\n            name: 'Yes ',\n            value: defaultTemplatePath\n          },\n          {\n            name: 'No',\n            value: defaultNoHtmlTemplatePath\n          }\n        ]\n      }\n    ])\n  })\n})\n"
  },
  {
    "path": "src/clean-context.js",
    "content": "/**\n * Clean answer context\n *\n * @param {Object} context\n */\nmodule.exports = context => {\n  const cleanBadgeText = text => text.replace(/-/g, '--').replace(/_/g, '__')\n\n  // Why doing this?\n  // See https://github.com/kefranabg/readme-md-generator/pull/141\n  const licenseName = context.licenseName\n    .replace(/-/g, '--')\n    .replace(/_/g, '__')\n  const projectVersion = cleanBadgeText(context.projectVersion)\n\n  return {\n    ...context,\n    licenseName,\n    projectVersion\n  }\n}\n"
  },
  {
    "path": "src/clean-context.spec.js",
    "content": "const cleanContext = require('./clean-context')\n\ndescribe('cleanContext', () => {\n  it('should replace licenseName and projectVersion - and _ characters by -- and __', () => {\n    const context = {\n      licenseName: 'Apache-2_0',\n      projectVersion: '1.0_0-alpha'\n    }\n    const cleanedContext = {\n      licenseName: 'Apache--2__0',\n      projectVersion: '1.0__0--alpha'\n    }\n\n    const result = cleanContext(context)\n\n    expect(result).toEqual(cleanedContext)\n  })\n})\n"
  },
  {
    "path": "src/cli.js",
    "content": "const readme = require('./readme')\nconst infos = require('./project-infos')\nconst utils = require('./utils')\nconst askQuestions = require('./ask-questions')\nconst cleanContext = require('./clean-context')\n\n/**\n * Main process:\n * 1) Check overwrite README.md\n * 2) Get README template path\n * 3) Gather project infos\n * 4) Ask user questions\n * 5) Clean answer context\n * 6) Build README content\n * 7) Create README.md file\n *\n * @param {Object} args\n */\nmodule.exports = async ({ customTemplatePath, useDefaultAnswers }) => {\n  if (!(await readme.checkOverwriteReadme())) return\n\n  const templatePath = await readme.getReadmeTemplatePath(\n    customTemplatePath,\n    useDefaultAnswers\n  )\n  const projectInformations = await infos.getProjectInfos()\n  const answersContext = await askQuestions(\n    projectInformations,\n    useDefaultAnswers\n  )\n  const cleanedContext = cleanContext(answersContext)\n  const readmeContent = await readme.buildReadmeContent(\n    cleanedContext,\n    templatePath\n  )\n\n  await readme.writeReadme(readmeContent)\n\n  utils.showEndMessage()\n}\n"
  },
  {
    "path": "src/cli.spec.js",
    "content": "const inquirer = require('inquirer')\nconst mainProcess = require('./cli')\nconst infos = require('./project-infos')\nconst readme = require('./readme')\nconst utils = require('./utils')\nconst askQuestions = require('./ask-questions')\nconst cleanContext = require('./clean-context')\n\ninquirer.prompt = jest.fn(items =>\n  Promise.resolve(\n    items.reduce((result, item) => {\n      result[item.name] = 'value'\n      return result\n    }, {})\n  )\n)\n\njest.mock('./ask-questions', () =>\n  jest.fn(() => Promise.resolve({ projectName: 'readme-md-generator' }))\n)\n\njest.mock('./clean-context', () =>\n  jest.fn(() => ({ projectName: 'readme-md-generator-after-context-clean' }))\n)\n\njest.mock('./questions', () => ({\n  askProjectName: jest.fn(() => ({\n    name: 'projectName',\n    type: 'input',\n    default: 'defaultProjectName'\n  })),\n  askProjectVersion: jest.fn(() => ({\n    name: 'projectVersion',\n    type: 'input'\n  })),\n  askProjectDescription: jest.fn(() => ({\n    name: 'projectDescription',\n    type: 'checkbox',\n    choices: [\n      { value: { name: 'choiceOne', value: 1 }, checked: true },\n      { value: { name: 'choiceTwo', value: 2 }, checked: false }\n    ]\n  }))\n}))\n\ndescribe('mainProcess', () => {\n  afterEach(() => {\n    askQuestions.mockClear()\n  })\n\n  it('should stop immediatly if user dont want overwrite', async () => {\n    const customTemplatePath = undefined\n    const useDefaultAnswers = true\n    infos.getProjectInfos = jest.fn()\n    readme.buildReadmeContent = jest.fn()\n    readme.getReadmeTemplatePath = jest.fn()\n    readme.writeReadme = jest.fn()\n    readme.checkOverwriteReadme = jest.fn(() => Promise.resolve(false))\n    utils.showEndMessage = jest.fn()\n\n    await mainProcess({ customTemplatePath, useDefaultAnswers })\n\n    expect(infos.getProjectInfos).not.toHaveBeenCalled()\n    expect(cleanContext).not.toHaveBeenCalled()\n    expect(readme.buildReadmeContent).not.toHaveBeenCalled()\n    expect(readme.getReadmeTemplatePath).not.toHaveBeenCalled()\n    expect(readme.writeReadme).not.toHaveBeenCalled()\n    expect(utils.showEndMessage).not.toHaveBeenCalled()\n  })\n\n  it('should call main functions with correct args', async () => {\n    const customTemplatePath = undefined\n    const useDefaultAnswers = true\n    const projectInformations = { name: 'readme-md-generator' }\n    const readmeContent = 'content'\n    const templatePath = 'path/to/template'\n    infos.getProjectInfos = jest.fn(() => Promise.resolve(projectInformations))\n    readme.buildReadmeContent = jest.fn(() => Promise.resolve(readmeContent))\n    readme.getReadmeTemplatePath = jest.fn(() => Promise.resolve(templatePath))\n    readme.checkOverwriteReadme = jest.fn(() => Promise.resolve(true))\n    readme.writeReadme = jest.fn()\n    utils.showEndMessage = jest.fn()\n\n    await mainProcess({ customTemplatePath, useDefaultAnswers })\n\n    expect(readme.getReadmeTemplatePath).toHaveBeenNthCalledWith(\n      1,\n      customTemplatePath,\n      useDefaultAnswers\n    )\n    expect(infos.getProjectInfos).toHaveBeenCalledTimes(1)\n    expect(askQuestions).toHaveBeenNthCalledWith(\n      1,\n      projectInformations,\n      useDefaultAnswers\n    )\n    expect(cleanContext).toHaveBeenNthCalledWith(1, {\n      projectName: 'readme-md-generator'\n    })\n    expect(readme.buildReadmeContent).toHaveBeenNthCalledWith(\n      1,\n      { projectName: 'readme-md-generator-after-context-clean' },\n      templatePath\n    )\n    expect(readme.writeReadme).toHaveBeenNthCalledWith(1, readmeContent)\n    expect(utils.showEndMessage).toHaveBeenCalledTimes(1)\n  })\n})\n"
  },
  {
    "path": "src/index.js",
    "content": "#!/usr/bin/env node\n\nconst yargs = require('yargs')\nconst { noop } = require('lodash')\n\nconst mainProcess = require('./cli')\n\nyargs\n  .usage('Usage: $0 <command> [options]')\n  .command('$0', 'Generate README.md', noop, args => {\n    const { path: customTemplatePath, yes: useDefaultAnswers } = args\n    mainProcess({ customTemplatePath, useDefaultAnswers })\n  })\n  .string('p')\n  .alias('p', 'path')\n  .describe('path', 'Path to your own template')\n  .boolean('yes')\n  .alias('y', 'yes')\n  .describe('yes', 'Use default values for all fields')\n  .help()\n  .alias('v', 'version')\n  .epilog(\n    'for more information, find our manual at https://github.com/kefranabg/readme-md-generator'\n  )\n  .parse()\n"
  },
  {
    "path": "src/project-infos.js",
    "content": "const isNil = require('lodash/isNil')\nconst get = require('lodash/get')\nconst has = require('lodash/has')\nconst ora = require('ora')\nconst { execSync } = require('child_process')\n\nconst {\n  getPackageJson,\n  getProjectName,\n  getAuthorWebsiteFromGithubAPI,\n  getPackageManagerFromLockFile\n} = require('./utils')\n\nconst GITHUB_URL = 'https://github.com/'\n\n/**\n * Clean repository url by removing '.git' and 'git+'\n *\n * @param {string} reposUrl\n */\nconst cleanReposUrl = reposUrl =>\n  reposUrl\n    .replace('\\n', '')\n    .replace('git+', '')\n    .replace('.git', '')\n\n/**\n * Get repository url from pakage json\n *\n * @param {Object} reposUrl\n */\nconst getReposUrlFromPackageJson = async packageJson => {\n  const reposUrl = get(packageJson, 'repository.url', undefined)\n  return isNil(reposUrl) ? undefined : cleanReposUrl(reposUrl)\n}\n\n/**\n * Get repository url from git\n */\nconst getReposUrlFromGit = () => {\n  try {\n    const stdout = execSync('git config --get remote.origin.url')\n    return cleanReposUrl(stdout)\n  } catch (err) {\n    return undefined\n  }\n}\n\n/**\n * Get repository url from package.json or git\n *\n * @param {Object} packageJson\n */\nconst getReposUrl = async packageJson =>\n  (await getReposUrlFromPackageJson(packageJson)) || getReposUrlFromGit()\n\n/**\n * Get repository issues url from package.json or git\n *\n * @param {Object} packageJson\n */\nconst getReposIssuesUrl = async packageJson => {\n  let reposIssuesUrl = get(packageJson, 'bugs.url', undefined)\n\n  if (isNil(reposIssuesUrl)) {\n    const reposUrl = await getReposUrl()\n\n    if (!isNil(reposUrl)) {\n      reposIssuesUrl = `${reposUrl}/issues`\n    }\n  }\n\n  return reposIssuesUrl\n}\n\n/**\n * Check if repository is a Github repository\n *\n * @param {string} repositoryUrl\n */\nconst isGithubRepository = repositoryUrl =>\n  !isNil(repositoryUrl) && repositoryUrl.includes(GITHUB_URL)\n\n/**\n * Get github username from repository url\n *\n * @param {string} repositoryUrl\n */\nconst getGithubUsernameFromRepositoryUrl = repositoryUrl =>\n  repositoryUrl.replace(GITHUB_URL, '').split('/')[0]\n\n/**\n * Get license url from github repository url\n *\n * @param {string} repositoryUrl\n */\nconst getLicenseUrlFromGithubRepositoryUrl = repositoryUrl =>\n  `${repositoryUrl}/blob/master/LICENSE`\n\nconst getReadmeUrlFromGithubRepositoryUrl = repositoryUrl =>\n  `${repositoryUrl}#readme`\n\nconst getContributingUrlFromRepositoryUrl = repositoryUrl =>\n  `${repositoryUrl}/blob/master/CONTRIBUTING.md`\n\n/**\n * Get project author name from package.json\n *\n * @param packageJson\n * @returns {string} authorName\n */\nconst getAuthorName = packageJson => {\n  if (has(packageJson, 'author.name')) {\n    return get(packageJson, 'author.name', undefined)\n  }\n\n  if (has(packageJson, 'author') && typeof packageJson.author === 'string') {\n    return get(packageJson, 'author', undefined)\n  }\n\n  return undefined\n}\n\n/**\n * Get project informations from git and package.json\n */\nconst getProjectInfos = async () => {\n  const spinner = ora('Gathering project infos').start()\n\n  const packageJson = await getPackageJson()\n  const isJSProject = !!packageJson\n  const packageManager = isJSProject\n    ? getPackageManagerFromLockFile()\n    : undefined\n  const name = getProjectName(packageJson)\n  const description = get(packageJson, 'description', undefined)\n  const engines = get(packageJson, 'engines', undefined)\n  const author = getAuthorName(packageJson)\n  const version = get(packageJson, 'version', undefined)\n  const licenseName = get(packageJson, 'license', undefined)\n  const homepage = get(packageJson, 'homepage', undefined)\n  const hasStartCommand = has(packageJson, 'scripts.start')\n  const hasTestCommand = has(packageJson, 'scripts.test')\n  const repositoryUrl = await getReposUrl(packageJson)\n  const issuesUrl = await getReposIssuesUrl(packageJson)\n  const isGithubRepos = isGithubRepository(repositoryUrl)\n  const contributingUrl = repositoryUrl\n    ? getContributingUrlFromRepositoryUrl(repositoryUrl)\n    : undefined\n  const documentationUrl = isGithubRepos\n    ? getReadmeUrlFromGithubRepositoryUrl(repositoryUrl)\n    : undefined\n  const githubUsername = isGithubRepos\n    ? getGithubUsernameFromRepositoryUrl(repositoryUrl)\n    : undefined\n  const authorWebsite = githubUsername\n    ? await getAuthorWebsiteFromGithubAPI(githubUsername)\n    : undefined\n  const licenseUrl = isGithubRepos\n    ? getLicenseUrlFromGithubRepositoryUrl(repositoryUrl)\n    : undefined\n\n  spinner.succeed('Project infos gathered')\n\n  return {\n    name,\n    description,\n    version,\n    author,\n    authorWebsite,\n    homepage,\n    repositoryUrl,\n    issuesUrl,\n    contributingUrl,\n    githubUsername,\n    engines,\n    licenseName,\n    licenseUrl,\n    documentationUrl,\n    isGithubRepos,\n    hasStartCommand,\n    hasTestCommand,\n    isJSProject,\n    packageManager\n  }\n}\n\nmodule.exports = {\n  getProjectInfos\n}\n"
  },
  {
    "path": "src/project-infos.spec.js",
    "content": "const ora = require('ora')\nconst childProcess = require('child_process')\n\nconst utils = require('./utils')\nconst { getProjectInfos } = require('./project-infos')\n\njest.mock('ora')\njest.mock('child_process', () => ({\n  execSync: jest.fn()\n}))\njest.mock('./utils', () => ({\n  getPackageJson: jest.fn(),\n  getProjectName: jest.fn(() => 'readme-md-generator'),\n  getAuthorWebsiteFromGithubAPI: jest.fn(\n    () => 'https://www.franck-abgrall.me/'\n  ),\n  getPackageManagerFromLockFile: jest.fn(() => 'yarn')\n}))\n\nconst succeed = jest.fn()\nconst fail = jest.fn()\n\nora.mockReturnValue({\n  start: () => ({\n    succeed,\n    fail\n  })\n})\n\ndescribe('projectInfos', () => {\n  describe('getProjectInfos', () => {\n    it('should call ora with correct parameters', async () => {\n      await getProjectInfos()\n\n      expect(ora).toHaveBeenCalledTimes(1)\n      expect(ora).toHaveBeenCalledWith('Gathering project infos')\n      expect(succeed).toHaveBeenCalledTimes(1)\n      expect(succeed).toHaveBeenCalledWith('Project infos gathered')\n    })\n\n    it('should return correct infos', async () => {\n      const packgeJsonInfos = {\n        name: 'readme-md-generator',\n        version: '0.1.3',\n        description: 'CLI that generates beautiful README.md files.',\n        author: 'Franck Abgrall',\n        license: 'MIT',\n        homepage: 'https://github.com/kefranabg/readme-md-generator',\n        repository: {\n          type: 'git',\n          url: 'git+https://github.com/kefranabg/readme-md-generator.git'\n        },\n        bugs: {\n          url: 'https://github.com/kefranabg/readme-md-generator/issues'\n        },\n        engines: {\n          npm: '>=5.5.0',\n          node: '>=9.3.0'\n        }\n      }\n      utils.getPackageJson.mockReturnValueOnce(Promise.resolve(packgeJsonInfos))\n      childProcess.execSync.mockReturnValue(\n        'https://github.com/kefranabg/readme-md-generator.git'\n      )\n\n      const projectInfos = await getProjectInfos()\n\n      expect(projectInfos).toEqual({\n        name: 'readme-md-generator',\n        description: 'CLI that generates beautiful README.md files.',\n        version: '0.1.3',\n        author: 'Franck Abgrall',\n        repositoryUrl: 'https://github.com/kefranabg/readme-md-generator',\n        homepage: 'https://github.com/kefranabg/readme-md-generator',\n        contributingUrl:\n          'https://github.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md',\n        authorWebsite: 'https://www.franck-abgrall.me/',\n        githubUsername: 'kefranabg',\n        engines: {\n          npm: '>=5.5.0',\n          node: '>=9.3.0'\n        },\n        licenseName: 'MIT',\n        licenseUrl:\n          'https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE',\n        documentationUrl:\n          'https://github.com/kefranabg/readme-md-generator#readme',\n        isGithubRepos: true,\n        isJSProject: true,\n        issuesUrl: 'https://github.com/kefranabg/readme-md-generator/issues',\n        hasStartCommand: false,\n        hasTestCommand: false,\n        packageManager: 'yarn'\n      })\n    })\n\n    it('should return correct infos when repos is not github', async () => {\n      const packgeJsonInfos = {\n        name: 'readme-md-generator',\n        version: '0.1.3',\n        description: 'CLI that generates beautiful README.md files.',\n        author: 'Franck Abgrall',\n        license: 'MIT',\n        homepage: 'https://gitlab.com/kefranabg/readme-md-generator',\n        repository: {\n          type: 'git',\n          url: 'git+https://gitlab.com/kefranabg/readme-md-generator.git'\n        },\n        bugs: {\n          url: 'https://gitlab.com/kefranabg/readme-md-generator/issues'\n        },\n        engines: {\n          npm: '>=5.5.0',\n          node: '>=9.3.0'\n        }\n      }\n      utils.getPackageJson.mockReturnValueOnce(Promise.resolve(packgeJsonInfos))\n      childProcess.execSync.mockReturnValue(\n        'https://github.com/kefranabg/readme-md-generator.git'\n      )\n\n      const projectInfos = await getProjectInfos()\n\n      expect(projectInfos).toEqual({\n        name: 'readme-md-generator',\n        description: 'CLI that generates beautiful README.md files.',\n        version: '0.1.3',\n        author: 'Franck Abgrall',\n        repositoryUrl: 'https://gitlab.com/kefranabg/readme-md-generator',\n        contributingUrl:\n          'https://gitlab.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md',\n        homepage: 'https://gitlab.com/kefranabg/readme-md-generator',\n        githubUsername: undefined,\n        authorWebsite: undefined,\n        engines: {\n          npm: '>=5.5.0',\n          node: '>=9.3.0'\n        },\n        licenseName: 'MIT',\n        licenseUrl: undefined,\n        documentationUrl: undefined,\n        isGithubRepos: false,\n        isJSProject: true,\n        issuesUrl: 'https://gitlab.com/kefranabg/readme-md-generator/issues',\n        hasStartCommand: false,\n        hasTestCommand: false,\n        packageManager: 'yarn'\n      })\n    })\n\n    it('should return correct infos when package.json is not defined', async () => {\n      utils.getPackageJson.mockReturnValueOnce(Promise.resolve(undefined))\n      childProcess.execSync.mockReturnValue(\n        'https://github.com/kefranabg/readme-md-generator.git'\n      )\n\n      const projectInfos = await getProjectInfos()\n\n      expect(projectInfos).toEqual({\n        name: 'readme-md-generator',\n        description: undefined,\n        version: undefined,\n        author: undefined,\n        repositoryUrl: 'https://github.com/kefranabg/readme-md-generator',\n        contributingUrl:\n          'https://github.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md',\n        homepage: undefined,\n        githubUsername: 'kefranabg',\n        authorWebsite: 'https://www.franck-abgrall.me/',\n        engines: undefined,\n        licenseName: undefined,\n        licenseUrl:\n          'https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE',\n        documentationUrl:\n          'https://github.com/kefranabg/readme-md-generator#readme',\n        isGithubRepos: true,\n        isJSProject: false,\n        issuesUrl: 'https://github.com/kefranabg/readme-md-generator/issues',\n        hasStartCommand: false,\n        hasTestCommand: false\n      })\n    })\n\n    it('should return correct infos when repos is not github and package.json are not defined', async () => {\n      utils.getPackageJson.mockReturnValueOnce(Promise.resolve(undefined))\n      childProcess.execSync.mockReturnValue(\n        'https://gitlab.com/kefranabg/readme-md-generator.git'\n      )\n\n      const projectInfos = await getProjectInfos()\n\n      expect(projectInfos).toEqual({\n        name: 'readme-md-generator',\n        description: undefined,\n        version: undefined,\n        author: undefined,\n        repositoryUrl: 'https://gitlab.com/kefranabg/readme-md-generator',\n        authorWebsite: undefined,\n        contributingUrl:\n          'https://gitlab.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md',\n        homepage: undefined,\n        githubUsername: undefined,\n        engines: undefined,\n        licenseName: undefined,\n        licenseUrl: undefined,\n        documentationUrl: undefined,\n        isGithubRepos: false,\n        isJSProject: false,\n        issuesUrl: 'https://gitlab.com/kefranabg/readme-md-generator/issues',\n        hasStartCommand: false,\n        hasTestCommand: false\n      })\n    })\n\n    it('should return correct infos when git config and package.json are not defined', async () => {\n      utils.getPackageJson.mockReturnValueOnce(Promise.resolve(undefined))\n      childProcess.execSync.mockImplementation(() => {\n        throw new Error('error')\n      })\n\n      const projectInfos = await getProjectInfos()\n\n      expect(projectInfos).toEqual({\n        name: 'readme-md-generator',\n        description: undefined,\n        version: undefined,\n        author: undefined,\n        repositoryUrl: undefined,\n        contributingUrl: undefined,\n        homepage: undefined,\n        authorWebsite: undefined,\n        githubUsername: undefined,\n        engines: undefined,\n        licenseName: undefined,\n        licenseUrl: undefined,\n        documentationUrl: undefined,\n        isGithubRepos: false,\n        isJSProject: false,\n        testCommand: undefined,\n        hasStartCommand: false,\n        hasTestCommand: false\n      })\n    })\n\n    it('should return correct infos when git config is not defined', async () => {\n      const packgeJsonInfos = {\n        name: 'readme-md-generator',\n        version: '0.1.3',\n        description: 'CLI that generates beautiful README.md files.',\n        author: 'Franck Abgrall',\n        license: 'MIT',\n        homepage: 'https://github.com/kefranabg/readme-md-generator',\n        repository: {\n          type: 'git',\n          url: 'git+https://github.com/kefranabg/readme-md-generator.git'\n        },\n        bugs: {\n          url: 'https://github.com/kefranabg/readme-md-generator/issues'\n        },\n        engines: {\n          npm: '>=5.5.0',\n          node: '>=9.3.0'\n        }\n      }\n      utils.getPackageJson.mockReturnValueOnce(Promise.resolve(packgeJsonInfos))\n      childProcess.execSync.mockImplementation(() => {\n        throw new Error('error')\n      })\n\n      const projectInfos = await getProjectInfos()\n\n      expect(projectInfos).toEqual({\n        name: 'readme-md-generator',\n        description: 'CLI that generates beautiful README.md files.',\n        version: '0.1.3',\n        author: 'Franck Abgrall',\n        repositoryUrl: 'https://github.com/kefranabg/readme-md-generator',\n        contributingUrl:\n          'https://github.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md',\n        homepage: 'https://github.com/kefranabg/readme-md-generator',\n        githubUsername: 'kefranabg',\n        authorWebsite: 'https://www.franck-abgrall.me/',\n        engines: {\n          npm: '>=5.5.0',\n          node: '>=9.3.0'\n        },\n        licenseName: 'MIT',\n        licenseUrl:\n          'https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE',\n        documentationUrl:\n          'https://github.com/kefranabg/readme-md-generator#readme',\n        isGithubRepos: true,\n        isJSProject: true,\n        issuesUrl: 'https://github.com/kefranabg/readme-md-generator/issues',\n        hasStartCommand: false,\n        hasTestCommand: false,\n        packageManager: 'yarn'\n      })\n    })\n\n    it('should return correct infos when author is defined as an object', async () => {\n      const packgeJsonInfos = {\n        name: 'readme-md-generator',\n        version: '0.1.3',\n        description: 'CLI that generates beautiful README.md files.',\n        author: {\n          name: 'Franck Abgrall',\n          email: 'abgrallkefran@gmail.com',\n          url: ''\n        },\n        license: 'MIT',\n        homepage: 'https://github.com/kefranabg/readme-md-generator',\n        repository: {\n          type: 'git',\n          url: 'git+https://github.com/kefranabg/readme-md-generator.git'\n        },\n        bugs: {\n          url: 'https://github.com/kefranabg/readme-md-generator/issues'\n        },\n        engines: {\n          npm: '>=5.5.0',\n          node: '>=9.3.0'\n        }\n      }\n      utils.getPackageJson.mockReturnValueOnce(Promise.resolve(packgeJsonInfos))\n      childProcess.execSync.mockReturnValue(\n        'https://github.com/kefranabg/readme-md-generator.git'\n      )\n\n      const projectInfos = await getProjectInfos()\n\n      expect(projectInfos).toEqual({\n        name: 'readme-md-generator',\n        description: 'CLI that generates beautiful README.md files.',\n        version: '0.1.3',\n        author: 'Franck Abgrall',\n        repositoryUrl: 'https://github.com/kefranabg/readme-md-generator',\n        homepage: 'https://github.com/kefranabg/readme-md-generator',\n        contributingUrl:\n          'https://github.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md',\n        githubUsername: 'kefranabg',\n        authorWebsite: 'https://www.franck-abgrall.me/',\n        engines: {\n          npm: '>=5.5.0',\n          node: '>=9.3.0'\n        },\n        licenseName: 'MIT',\n        licenseUrl:\n          'https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE',\n        documentationUrl:\n          'https://github.com/kefranabg/readme-md-generator#readme',\n        isGithubRepos: true,\n        isJSProject: true,\n        issuesUrl: 'https://github.com/kefranabg/readme-md-generator/issues',\n        hasStartCommand: false,\n        hasTestCommand: false,\n        packageManager: 'yarn'\n      })\n    })\n\n    it('should return correct infos when lock file is found', async () => {\n      const packgeJsonInfos = {\n        name: 'readme-md-generator',\n        version: '0.1.3',\n        description: 'CLI that generates beautiful README.md files.',\n        author: 'Franck Abgrall',\n        license: 'MIT',\n        homepage: 'https://github.com/kefranabg/readme-md-generator',\n        repository: {\n          type: 'git',\n          url: 'git+https://github.com/kefranabg/readme-md-generator.git'\n        },\n        bugs: {\n          url: 'https://github.com/kefranabg/readme-md-generator/issues'\n        },\n        engines: {\n          npm: '>=5.5.0',\n          node: '>=9.3.0'\n        },\n        scripts: {\n          start: 'node src/index.js',\n          test: 'jest'\n        }\n      }\n      utils.getPackageJson.mockReturnValueOnce(Promise.resolve(packgeJsonInfos))\n      utils.getPackageManagerFromLockFile.mockReturnValueOnce('yarn')\n      childProcess.execSync.mockReturnValue(\n        'https://github.com/kefranabg/readme-md-generator.git'\n      )\n\n      const projectInfos = await getProjectInfos()\n\n      expect(projectInfos).toEqual({\n        name: 'readme-md-generator',\n        description: 'CLI that generates beautiful README.md files.',\n        version: '0.1.3',\n        author: 'Franck Abgrall',\n        repositoryUrl: 'https://github.com/kefranabg/readme-md-generator',\n        homepage: 'https://github.com/kefranabg/readme-md-generator',\n        contributingUrl:\n          'https://github.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md',\n        authorWebsite: 'https://www.franck-abgrall.me/',\n        githubUsername: 'kefranabg',\n        engines: {\n          npm: '>=5.5.0',\n          node: '>=9.3.0'\n        },\n        licenseName: 'MIT',\n        licenseUrl:\n          'https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE',\n        documentationUrl:\n          'https://github.com/kefranabg/readme-md-generator#readme',\n        isGithubRepos: true,\n        isJSProject: true,\n        issuesUrl: 'https://github.com/kefranabg/readme-md-generator/issues',\n        hasStartCommand: true,\n        hasTestCommand: true,\n        packageManager: 'yarn'\n      })\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/author-github.js",
    "content": "const { cleanSocialNetworkUsername } = require('../utils')\n\nmodule.exports = projectInfos => ({\n  type: 'input',\n  message: '👤  GitHub username (use empty value to skip)',\n  name: 'authorGithubUsername',\n  default: projectInfos.githubUsername,\n  filter: cleanSocialNetworkUsername\n})\n"
  },
  {
    "path": "src/questions/author-github.spec.js",
    "content": "const askAuthorGithub = require('./author-github')\n\ndescribe('askAuthorGithub', () => {\n  it('should return correct question format', () => {\n    const githubUsername = 'kefranabg'\n    const projectInfos = { githubUsername }\n\n    const result = askAuthorGithub(projectInfos)\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '👤  GitHub username (use empty value to skip)',\n      name: 'authorGithubUsername',\n      default: githubUsername,\n      filter: expect.any(Function)\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/author-linkedin.js",
    "content": "const { cleanSocialNetworkUsername } = require('../utils')\n\nmodule.exports = () => ({\n  type: 'input',\n  message: '💼  LinkedIn username (use empty value to skip)',\n  name: 'authorLinkedInUsername',\n  filter: cleanSocialNetworkUsername\n})\n"
  },
  {
    "path": "src/questions/author-linkedin.spec.js",
    "content": "const askAuthorLinkedIn = require('./author-linkedin')\n\ndescribe('askAuthorLinkedIn', () => {\n  it('should return correct question format', () => {\n    const result = askAuthorLinkedIn()\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '💼  LinkedIn username (use empty value to skip)',\n      name: 'authorLinkedInUsername',\n      filter: expect.any(Function)\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/author-name.js",
    "content": "module.exports = projectInfos => ({\n  type: 'input',\n  message: '👤  Author name',\n  name: 'authorName',\n  default: projectInfos.author\n})\n"
  },
  {
    "path": "src/questions/author-name.spec.js",
    "content": "const askAuthorName = require('./author-name')\n\ndescribe('askAuthorName', () => {\n  it('should return correct question format', () => {\n    const author = 'Franck Abgrall'\n    const projectInfos = { author }\n\n    const result = askAuthorName(projectInfos)\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '👤  Author name',\n      name: 'authorName',\n      default: author\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/author-patreon.js",
    "content": "const { cleanSocialNetworkUsername } = require('../utils')\n\nmodule.exports = () => ({\n  type: 'input',\n  message: '❤️  Patreon username (use empty value to skip)',\n  name: 'authorPatreonUsername',\n  filter: cleanSocialNetworkUsername\n})\n"
  },
  {
    "path": "src/questions/author-patreon.spec.js",
    "content": "const askPatreonUsername = require('./author-patreon')\n\ndescribe('askPatreonUsername', () => {\n  it('should return correct question format', () => {\n    const result = askPatreonUsername()\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '❤️  Patreon username (use empty value to skip)',\n      name: 'authorPatreonUsername',\n      filter: expect.any(Function)\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/author-twitter.js",
    "content": "const { cleanSocialNetworkUsername } = require('../utils')\n\nmodule.exports = () => ({\n  type: 'input',\n  message: '🐦  Twitter username (use empty value to skip)',\n  name: 'authorTwitterUsername',\n  filter: cleanSocialNetworkUsername\n})\n"
  },
  {
    "path": "src/questions/author-twitter.spec.js",
    "content": "const askAuthorTwitter = require('./author-twitter')\n\ndescribe('askAuthorTwitter', () => {\n  it('should return correct question format', () => {\n    const result = askAuthorTwitter()\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '🐦  Twitter username (use empty value to skip)',\n      name: 'authorTwitterUsername',\n      filter: expect.any(Function)\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/author-website.js",
    "content": "const { getAuthorWebsiteFromGithubAPI } = require('../utils')\n\nmodule.exports = projectInfos => ({\n  type: 'input',\n  message: '🏠  Author website (use empty value to skip)',\n  name: 'authorWebsite',\n  default: async answers =>\n    answers.authorGithubUsername !== projectInfos.githubUsername\n      ? getAuthorWebsiteFromGithubAPI(answers.authorGithubUsername)\n      : projectInfos.authorWebsite\n})\n"
  },
  {
    "path": "src/questions/author-website.spec.js",
    "content": "const fetch = require('node-fetch')\nconst askAuthorWebsite = require('./author-website')\n\njest.mock('node-fetch')\n\ndescribe('askAuthorWebsite', () => {\n  it('should return correct question format', () => {\n    const authorWebsite = 'authorWebsite'\n    const projectInfos = { authorWebsite }\n\n    const result = askAuthorWebsite(projectInfos)\n\n    expect(result).toEqual(\n      expect.objectContaining({\n        type: 'input',\n        message: '🏠  Author website (use empty value to skip)',\n        name: 'authorWebsite'\n      })\n    )\n  })\n\n  it('should return a new website url if user changes its github username with the previous question', async () => {\n    const blog = 'https://www.new-website-url.com/'\n    const projectInfos = {\n      githubUsername: 'kefranabg',\n      authorWebsite: 'https://www.franck-abgrall.me/'\n    }\n\n    fetch.mockReturnValueOnce(\n      Promise.resolve({\n        json: () => Promise.resolve({ blog })\n      })\n    )\n\n    const result = await askAuthorWebsite(projectInfos).default({\n      authorGithubUsername: 'newGitHubUsername'\n    })\n\n    expect(result).toEqual(blog)\n  })\n\n  it('should return project infos website url if github username did not change', async () => {\n    const projectInfos = {\n      githubUsername: 'kefranabg',\n      authorWebsite: 'https://www.franck-abgrall.me/'\n    }\n\n    const result = await askAuthorWebsite(projectInfos).default({\n      authorGithubUsername: 'kefranabg'\n    })\n\n    expect(result).toEqual(projectInfos.authorWebsite)\n  })\n})\n"
  },
  {
    "path": "src/questions/contributing-url.js",
    "content": "module.exports = projectInfos => ({\n  type: 'input',\n  message: '🤝  Contributing guide url (use empty value to skip)',\n  name: 'contributingUrl',\n  default: projectInfos.contributingUrl\n})\n"
  },
  {
    "path": "src/questions/contributing-url.spec.js",
    "content": "const askContributingUrl = require('./contributing-url')\n\ndescribe('askContributingUrl', () => {\n  it('should return correct question format', () => {\n    const contributingUrl =\n      'https://github.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md'\n    const projectInfos = { contributingUrl }\n\n    const result = askContributingUrl(projectInfos)\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '🤝  Contributing guide url (use empty value to skip)',\n      name: 'contributingUrl',\n      default: contributingUrl\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/index.js",
    "content": "/* eslint-disable global-require */\nmodule.exports = {\n  askProjectName: require('./project-name'),\n  askProjectVersion: require('./project-version'),\n  askProjectDescription: require('./project-description'),\n  askPackageManager: require('./package-manager'),\n  askProjectHomepage: require('./project-homepage'),\n  askProjectDemoUrl: require('./project-demo-url'),\n  askProjectDocumentationUrl: require('./project-documentation-url'),\n  askAuhtorName: require('./author-name'),\n  askAuthorGithub: require('./author-github'),\n  askAuthorWebsite: require('./author-website'),\n  askAuthorTwitter: require('./author-twitter'),\n  askAuthorLinkedIn: require('./author-linkedin'),\n  askAuthorPatreon: require('./author-patreon'),\n  askProjectPrerequisites: require('./project-prerequisites'),\n  askLicenseName: require('./license-name'),\n  askLicenseUrl: require('./license-url'),\n  askIssuesUrl: require('./issues-url'),\n  askContributingUrl: require('./contributing-url'),\n  askInstallCommand: require('./install-command'),\n  askUsage: require('./usage'),\n  askTestCommand: require('./test-command')\n}\n"
  },
  {
    "path": "src/questions/index.spec.js",
    "content": "const questions = require('./')\n\ndescribe('questions', () => {\n  it('should export questions in the correct order', () => {\n    const questionsNameOrder = Object.keys(questions)\n\n    expect(questionsNameOrder).toEqual([\n      'askProjectName',\n      'askProjectVersion',\n      'askProjectDescription',\n      'askPackageManager',\n      'askProjectHomepage',\n      'askProjectDemoUrl',\n      'askProjectDocumentationUrl',\n      'askAuhtorName',\n      'askAuthorGithub',\n      'askAuthorWebsite',\n      'askAuthorTwitter',\n      'askAuthorLinkedIn',\n      'askAuthorPatreon',\n      'askProjectPrerequisites',\n      'askLicenseName',\n      'askLicenseUrl',\n      'askIssuesUrl',\n      'askContributingUrl',\n      'askInstallCommand',\n      'askUsage',\n      'askTestCommand'\n    ])\n  })\n})\n"
  },
  {
    "path": "src/questions/install-command.js",
    "content": "const isNil = require('lodash/isNil')\n\nmodule.exports = projectInfos => ({\n  type: 'input',\n  message: '📦  Install command (use empty value to skip)',\n  name: 'installCommand',\n  default: answers => {\n    const packageManager = answers.packageManager || projectInfos.packageManager\n    return isNil(packageManager) ? undefined : `${packageManager} install`\n  }\n})\n"
  },
  {
    "path": "src/questions/install-command.spec.js",
    "content": "const askInstallCommand = require('./install-command')\n\ndescribe('askInstallCommand', () => {\n  it('should return correct question format', () => {\n    const result = askInstallCommand()\n    expect(result).toEqual(\n      expect.objectContaining({\n        type: 'input',\n        message: '📦  Install command (use empty value to skip)',\n        name: 'installCommand'\n      })\n    )\n  })\n\n  it('should return undefined default answer when package manager is not defined', () => {\n    const projectInfos = {}\n\n    const result = askInstallCommand(projectInfos).default({\n      packageManager: undefined\n    })\n\n    expect(result).toBeUndefined()\n  })\n\n  it('should return correct default answer when package manager is defined', () => {\n    const projectInfos = {}\n\n    const result = askInstallCommand(projectInfos).default({\n      packageManager: 'yarn'\n    })\n\n    expect(result).toEqual('yarn install')\n  })\n})\n"
  },
  {
    "path": "src/questions/issues-url.js",
    "content": "module.exports = packageJson => ({\n  type: 'input',\n  message: '🔧  Issues page url (use empty value to skip)',\n  name: 'issuesUrl',\n  default: packageJson.issuesUrl\n})\n"
  },
  {
    "path": "src/questions/issues-url.spec.js",
    "content": "const askIssues = require('./issues-url')\n\ndescribe('askIssues', () => {\n  it('should return correct question format', () => {\n    const issuesUrl = 'https://github.com/kefranabg/readme-md-generator/issues'\n    const projectInfos = { issuesUrl }\n\n    const result = askIssues(projectInfos)\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '🔧  Issues page url (use empty value to skip)',\n      name: 'issuesUrl',\n      default: issuesUrl\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/license-name.js",
    "content": "module.exports = packageJson => ({\n  type: 'input',\n  message: '📝  License name (use empty value to skip)',\n  name: 'licenseName',\n  default: packageJson.licenseName\n})\n"
  },
  {
    "path": "src/questions/license-name.spec.js",
    "content": "const askLicenseName = require('./license-name')\n\ndescribe('askLicenseName', () => {\n  it('should return correct question format', () => {\n    const licenseName = 'MIT'\n    const projectInfos = { licenseName }\n\n    const result = askLicenseName(projectInfos)\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '📝  License name (use empty value to skip)',\n      name: 'licenseName',\n      default: licenseName\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/license-url.js",
    "content": "const isEmpty = require('lodash/isEmpty')\n\nmodule.exports = projectInfos => ({\n  type: 'input',\n  message: '📝  License url (use empty value to skip)',\n  name: 'licenseUrl',\n  default: projectInfos.licenseUrl,\n  when: answersContext => !isEmpty(answersContext.licenseName)\n})\n"
  },
  {
    "path": "src/questions/license-url.spec.js",
    "content": "const askLicenseUrl = require('./license-url')\n\ndescribe('askLicenseUrl', () => {\n  it('should return correct question format', () => {\n    const licenseUrl =\n      'https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE'\n    const projectInfos = { licenseUrl }\n\n    const result = askLicenseUrl(projectInfos)\n\n    expect(result).toEqual(\n      expect.objectContaining({\n        type: 'input',\n        message: '📝  License url (use empty value to skip)',\n        name: 'licenseUrl',\n        default: licenseUrl\n      })\n    )\n  })\n\n  it('should show this question if licenseName is defined', () => {\n    const projectInfos = {\n      licenseUrl:\n        'https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE'\n    }\n    const answersContext = { licenseName: 'MIT' }\n\n    const question = askLicenseUrl(projectInfos)\n    const result = question.when(answersContext)\n\n    expect(result).toBe(true)\n  })\n\n  it('should not show this question if licenseName is not defined', () => {\n    const projectInfos = {\n      licenseUrl:\n        'https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE'\n    }\n    const answersContext = {}\n\n    const question = askLicenseUrl(projectInfos)\n    const result = question.when(answersContext)\n\n    expect(result).toBe(false)\n  })\n})\n"
  },
  {
    "path": "src/questions/package-manager.js",
    "content": "const isEmpty = require('lodash/isEmpty')\n\nmodule.exports = projectInfos => ({\n  type: 'list',\n  message: '📦  Choose Package Manager ',\n  name: 'packageManager',\n  choices: [\n    {\n      name: 'npm',\n      value: 'npm'\n    },\n    {\n      name: 'yarn',\n      value: 'yarn'\n    }\n  ],\n  when: () => projectInfos.isJSProject && isEmpty(projectInfos.packageManager)\n})\n"
  },
  {
    "path": "src/questions/package-manager.spec.js",
    "content": "const askPackageManager = require('./package-manager')\n\nconst expectedQuestion = {\n  type: 'list',\n  message: '📦  Choose Package Manager ',\n  name: 'packageManager',\n  choices: [\n    {\n      name: 'npm',\n      value: 'npm'\n    },\n    {\n      name: 'yarn',\n      value: 'yarn'\n    }\n  ]\n}\n\ndescribe('askPackageManager', () => {\n  it('should return correct question format when package manager is undefined', () => {\n    const projectInfos = { packageManager: undefined }\n    const result = askPackageManager(projectInfos)\n\n    expect(result).toEqual(expect.objectContaining(expectedQuestion))\n  })\n\n  it('should not show question for a non JS Project', () => {\n    const projectInfos = { isJSProject: false, packageManager: undefined }\n    const result = askPackageManager(projectInfos).when(projectInfos)\n\n    expect(result).toBe(false)\n  })\n\n  it('should not show question when package manager has already been detected', () => {\n    const projectInfos = { isJSProject: true, packageManager: 'yarn' }\n    const result = askPackageManager(projectInfos).when(projectInfos)\n\n    expect(result).toBe(false)\n  })\n\n  it('should show question when package manager is undefined and if project is JS', () => {\n    const projectInfos = { isJSProject: true, packageManager: undefined }\n    const result = askPackageManager(projectInfos).when(projectInfos)\n\n    expect(result).toBe(true)\n  })\n})\n"
  },
  {
    "path": "src/questions/project-demo-url.js",
    "content": "module.exports = () => ({\n  type: 'input',\n  message: '✨  Project demo url (use empty value to skip)',\n  name: 'projectDemoUrl'\n})\n"
  },
  {
    "path": "src/questions/project-demo-url.spec.js",
    "content": "const askProjectDemoUrl = require('./project-demo-url')\n\ndescribe('askProjectDemoUrl', () => {\n  it('should return the correct question format', () => {\n    const result = askProjectDemoUrl()\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '✨  Project demo url (use empty value to skip)',\n      name: 'projectDemoUrl'\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/project-description.js",
    "content": "module.exports = projectInfos => ({\n  type: 'input',\n  message: '📄  Project description',\n  name: 'projectDescription',\n  default: projectInfos.description\n})\n"
  },
  {
    "path": "src/questions/project-description.spec.js",
    "content": "const askProjectDescription = require('./project-description')\n\ndescribe('askProjectDescription', () => {\n  it('should return correct question format', () => {\n    const description = 'description'\n    const projectInfos = { description }\n\n    const result = askProjectDescription(projectInfos)\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '📄  Project description',\n      name: 'projectDescription',\n      default: description\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/project-documentation-url.js",
    "content": "module.exports = projectInfos => ({\n  type: 'input',\n  message: '📘  Project documentation url (use empty value to skip)',\n  name: 'projectDocumentationUrl',\n  default: projectInfos.documentationUrl\n})\n"
  },
  {
    "path": "src/questions/project-documentation-url.spec.js",
    "content": "const askProjectName = require('./project-name')\n\ndescribe('askProjectName', () => {\n  it('should return correct question format', () => {\n    const name = 'readme-md-generator'\n    const projectInfos = { name }\n\n    const result = askProjectName(projectInfos)\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '💡  Project name',\n      name: 'projectName',\n      default: name\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/project-homepage.js",
    "content": "module.exports = projectInfos => ({\n  type: 'input',\n  message: '🏠  Project homepage (use empty value to skip)',\n  name: 'projectHomepage',\n  default: projectInfos.homepage\n})\n"
  },
  {
    "path": "src/questions/project-homepage.spec.js",
    "content": "const askProjectHomepage = require('./project-homepage')\n\ndescribe('askProjectHomepage', () => {\n  it('should return correct question format', () => {\n    const homepage = 'homepage'\n    const projectInfos = { homepage }\n\n    const result = askProjectHomepage(projectInfos)\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '🏠  Project homepage (use empty value to skip)',\n      name: 'projectHomepage',\n      default: homepage\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/project-name.js",
    "content": "module.exports = projectInfos => ({\n  type: 'input',\n  message: '💡  Project name',\n  name: 'projectName',\n  default: projectInfos.name\n})\n"
  },
  {
    "path": "src/questions/project-name.spec.js",
    "content": "const askProjectDocumentationUrl = require('./project-documentation-url')\n\ndescribe('askProjectDocumentationUrl', () => {\n  it('should return correct question format', () => {\n    const documentationUrl =\n      'https://github.com/kefranabg/readme-md-generator/blob/master/README.md'\n    const projectInfos = { documentationUrl }\n\n    const result = askProjectDocumentationUrl(projectInfos)\n\n    expect(result).toEqual({\n      type: 'input',\n      message: '📘  Project documentation url (use empty value to skip)',\n      name: 'projectDocumentationUrl',\n      default: documentationUrl\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/project-prerequisites.js",
    "content": "const isEmpty = require('lodash/isEmpty')\nconst isNil = require('lodash/isNil')\n\n/**\n * Return engines as formatted choices\n *\n * @param {Object} engines\n */\nconst buildFormattedChoices = engines =>\n  isNil(engines)\n    ? null\n    : Object.keys(engines).map(key => ({\n        name: `${key} ${engines[key]}`,\n        value: {\n          name: key,\n          value: engines[key]\n        },\n        checked: true\n      }))\n\n/**\n * Check if projectInfos has engines properties\n *\n * @param {Object} projectInfos\n */\nconst hasProjectInfosEngines = projectInfos =>\n  !isNil(projectInfos.engines) && !isEmpty(projectInfos.engines)\n\nmodule.exports = projectInfos => ({\n  type: 'checkbox',\n  message: '⚠️  Project prerequisites',\n  name: 'projectPrerequisites',\n  choices: buildFormattedChoices(projectInfos.engines),\n  when: () => hasProjectInfosEngines(projectInfos)\n})\n"
  },
  {
    "path": "src/questions/project-prerequisites.spec.js",
    "content": "const askProjectPrerequisites = require('./project-prerequisites')\n\ndescribe('askProjectPrerequisites', () => {\n  it('should return correct question format', () => {\n    const engines = {\n      npm: '>=5.5.0',\n      node: '>= 9.3.0'\n    }\n    const projectInfos = { engines }\n\n    const result = askProjectPrerequisites(projectInfos)\n\n    expect(result).toEqual(\n      expect.objectContaining({\n        type: 'checkbox',\n        message: '⚠️  Project prerequisites',\n        name: 'projectPrerequisites',\n        choices: [\n          {\n            checked: true,\n            name: 'npm >=5.5.0',\n            value: { name: 'npm', value: '>=5.5.0' }\n          },\n          {\n            checked: true,\n            name: 'node >= 9.3.0',\n            value: { name: 'node', value: '>= 9.3.0' }\n          }\n        ]\n      })\n    )\n  })\n\n  it('should not show the question when engines property is empty object', () => {\n    const projectInfos = { engines: {} }\n\n    const question = askProjectPrerequisites(projectInfos)\n    const result = question.when()\n\n    expect(result).toEqual(false)\n  })\n\n  it('should not show the question when engines property is not defined', () => {\n    const projectInfos = {}\n\n    const question = askProjectPrerequisites(projectInfos)\n    const result = question.when()\n\n    expect(result).toEqual(false)\n  })\n\n  it('should show the question when engines property is defined and not empty', () => {\n    const projectInfos = {\n      engines: {\n        node: '>=10'\n      }\n    }\n\n    const question = askProjectPrerequisites(projectInfos)\n    const result = question.when()\n\n    expect(result).toEqual(true)\n  })\n})\n"
  },
  {
    "path": "src/questions/project-version.js",
    "content": "module.exports = projectInfos => ({\n  type: 'input',\n  message: 'ℹ️  Project version (use empty value to skip)',\n  name: 'projectVersion',\n  default: projectInfos.version\n})\n"
  },
  {
    "path": "src/questions/project-version.spec.js",
    "content": "const askProjectVersion = require('./project-version')\n\ndescribe('askProjectVersion', () => {\n  it('should return correct question format', () => {\n    const version = '1.0.0'\n    const projectInfos = { version }\n\n    const result = askProjectVersion(projectInfos)\n\n    expect(result).toEqual({\n      type: 'input',\n      message: 'ℹ️  Project version (use empty value to skip)',\n      name: 'projectVersion',\n      default: version\n    })\n  })\n})\n"
  },
  {
    "path": "src/questions/test-command.js",
    "content": "const isNil = require('lodash/isNil')\n\nmodule.exports = projectInfos => ({\n  type: 'input',\n  message: '✅  Test command (use empty value to skip)',\n  name: 'testCommand',\n  default: answers => {\n    const packageManager = answers.packageManager || projectInfos.packageManager\n    return projectInfos.hasTestCommand && !isNil(packageManager)\n      ? `${packageManager} run test`\n      : undefined\n  }\n})\n"
  },
  {
    "path": "src/questions/test-command.spec.js",
    "content": "const askTestCommand = require('./test-command')\n\ndescribe('askTestCommand', () => {\n  it('should return correct question format', () => {\n    const result = askTestCommand()\n    expect(result).toEqual(\n      expect.objectContaining({\n        type: 'input',\n        message: '✅  Test command (use empty value to skip)',\n        name: 'testCommand'\n      })\n    )\n  })\n\n  it('should return undefined default answer when package manager does not exists', () => {\n    const projectInfos = { hasTestCommand: true }\n\n    const result = askTestCommand(projectInfos).default({\n      packageManager: undefined\n    })\n\n    expect(result).toBeUndefined()\n  })\n\n  it('should return undefined default answer when test command does not exists', () => {\n    const projectInfos = { hasTestCommand: false }\n\n    const result = askTestCommand(projectInfos).default({\n      packageManager: 'yarn'\n    })\n\n    expect(result).toBeUndefined()\n  })\n\n  it('should return correct default answer when start command and package manager exists', () => {\n    const projectInfos = { hasTestCommand: true }\n\n    const result = askTestCommand(projectInfos).default({\n      packageManager: 'yarn'\n    })\n\n    expect(result).toEqual('yarn run test')\n  })\n})\n"
  },
  {
    "path": "src/questions/usage.js",
    "content": "const isNil = require('lodash/isNil')\n\nmodule.exports = projectInfos => ({\n  type: 'input',\n  message: '🚀  Usage command or instruction (use empty value to skip)',\n  name: 'usage',\n  default: answers => {\n    const packageManager = answers.packageManager || projectInfos.packageManager\n    return projectInfos.hasStartCommand && !isNil(packageManager)\n      ? `${packageManager} run start`\n      : undefined\n  }\n})\n"
  },
  {
    "path": "src/questions/usage.spec.js",
    "content": "const askUsage = require('./usage')\n\ndescribe('askUsage', () => {\n  it('should return correct question format', () => {\n    const result = askUsage()\n\n    expect(result).toEqual(\n      expect.objectContaining({\n        type: 'input',\n        message: '🚀  Usage command or instruction (use empty value to skip)',\n        name: 'usage'\n      })\n    )\n  })\n\n  it('should return undefined default answer when package manager does not exists', () => {\n    const projectInfos = { hasStartCommand: true }\n\n    const result = askUsage(projectInfos).default({\n      packageManager: undefined\n    })\n\n    expect(result).toBeUndefined()\n  })\n\n  it('should return undefined default answer when start command does not exists', () => {\n    const projectInfos = { hasStartCommand: false }\n\n    const result = askUsage(projectInfos).default({\n      packageManager: 'yarn'\n    })\n\n    expect(result).toBeUndefined()\n  })\n\n  it('should return correct default answer when start command and packageManager exists', () => {\n    const projectInfos = { hasStartCommand: true }\n\n    const result = askUsage(projectInfos).default({\n      packageManager: 'yarn'\n    })\n\n    expect(result).toEqual('yarn run start')\n  })\n})\n"
  },
  {
    "path": "src/readme.js",
    "content": "const ejs = require('ejs')\nconst ora = require('ora')\nconst { promisify } = require('util')\nconst { getYear } = require('date-fns')\nconst fs = require('fs')\nconst { isNil, unescape } = require('lodash')\n\nconst chooseTemplate = require('./choose-template')\nconst askOverwriteReadme = require('./ask-overwrite')\n\nconst README_PATH = 'README.md'\n\n/**\n * Create readme file from the given readmeContent\n *\n * @param {string} readmeContent\n */\nconst writeReadme = async readmeContent => {\n  const spinner = ora('Creating README').start()\n\n  try {\n    await promisify(fs.writeFile)(README_PATH, unescape(readmeContent))\n    spinner.succeed('README created')\n  } catch (err) {\n    spinner.fail('README creation fail')\n    throw err\n  }\n}\n\n/**\n * Get README template content from the given templatePath\n *\n * @param {string} templatePath\n */\nconst getReadmeTemplate = async templatePath => {\n  const spinner = ora('Loading README template').start()\n\n  try {\n    const template = await promisify(fs.readFile)(templatePath, 'utf8')\n    spinner.succeed('README template loaded')\n    return template\n  } catch (err) {\n    spinner.fail('README template loading fail')\n    throw err\n  }\n}\n\n/**\n * Build README content with the given context and templatePath\n *\n * @param {Object} context\n * @param {string} templatePath\n */\nconst buildReadmeContent = async (context, templatePath) => {\n  const currentYear = getYear(new Date())\n  const template = await getReadmeTemplate(templatePath)\n\n  return ejs.render(template, {\n    filename: templatePath,\n    currentYear,\n    ...context\n  })\n}\n\n/**\n * Validate template path\n *\n * @param {string} templatePath\n */\nconst validateReadmeTemplatePath = templatePath => {\n  const spinner = ora('Resolving README template path').start()\n\n  try {\n    fs.lstatSync(templatePath).isFile()\n  } catch (err) {\n    spinner.fail(`The template path '${templatePath}' is not valid.`)\n    throw err\n  }\n\n  spinner.succeed('README template path resolved')\n}\n\n/**\n * Get readme template path\n * (either a custom template, or a template that user will choose from prompt)\n *\n * @param {String} customTemplate\n */\nconst getReadmeTemplatePath = async (customTemplate, useDefaultAnswers) => {\n  const templatePath = isNil(customTemplate)\n    ? await chooseTemplate(useDefaultAnswers)\n    : customTemplate\n\n  validateReadmeTemplatePath(templatePath)\n\n  return templatePath\n}\n\n/**\n * Check if readme generator can overwrite the existed readme\n */\nconst checkOverwriteReadme = () =>\n  !fs.existsSync(README_PATH) || askOverwriteReadme()\n\nmodule.exports = {\n  writeReadme,\n  buildReadmeContent,\n  README_PATH,\n  getReadmeTemplatePath,\n  checkOverwriteReadme\n}\n"
  },
  {
    "path": "src/readme.spec.js",
    "content": "const fs = require('fs')\nconst ora = require('ora')\nconst path = require('path')\nconst chooseTemplate = require('./choose-template')\nconst askOverwriteReadme = require('./ask-overwrite')\n\nconst defaultTemplatePath = path.resolve(__dirname, '../templates/default.md')\nconst defaultNoHtmlTemplatePath = path.resolve(\n  __dirname,\n  '../templates/default-no-html.md'\n)\nchooseTemplate.mockReturnValue(defaultTemplatePath)\n\nconst {\n  writeReadme,\n  buildReadmeContent,\n  README_PATH,\n  getReadmeTemplatePath,\n  checkOverwriteReadme\n} = require('./readme')\n\ndescribe('readme', () => {\n  const succeed = jest.fn()\n  const fail = jest.fn()\n\n  ora.mockReturnValue({\n    start: () => ({\n      succeed,\n      fail\n    })\n  })\n\n  afterEach(() => {\n    jest.clearAllMocks()\n  })\n\n  describe('writeReadme', () => {\n    it('should call ora with correct parameters in success case', async () => {\n      const readmeContent = 'content'\n      fs.writeFile = jest.fn((_, __, cb) => cb(null, 'done'))\n\n      await writeReadme(readmeContent)\n\n      expect(ora).toHaveBeenCalledTimes(1)\n      expect(ora).toHaveBeenCalledWith('Creating README')\n      expect(succeed).toHaveBeenCalledTimes(1)\n      expect(succeed).toHaveBeenCalledWith('README created')\n    })\n\n    it('should call ora with correct parameters in fail case', async () => {\n      const readmeContent = 'content'\n      fs.writeFile = jest.fn(() => {\n        throw new Error('error')\n      })\n\n      try {\n        await writeReadme(readmeContent)\n        // eslint-disable-next-line no-empty\n      } catch (err) {}\n\n      expect(ora).toHaveBeenCalledTimes(1)\n      expect(ora).toHaveBeenCalledWith('Creating README')\n      expect(fail).toHaveBeenCalledTimes(1)\n      expect(fail).toHaveBeenCalledWith('README creation fail')\n    })\n\n    it('should call writeFile with correct parameters', async () => {\n      const readmeContent = 'John &amp; Bryan'\n      fs.writeFile = jest.fn((_, __, cb) => cb(null, 'done'))\n\n      await writeReadme(readmeContent)\n\n      expect(fs.writeFile).toHaveBeenCalledTimes(1)\n      expect(fs.writeFile.mock.calls[0][0]).toBe(README_PATH)\n      expect(fs.writeFile.mock.calls[0][1]).toBe('John & Bryan')\n    })\n  })\n\n  describe('buildReadmeContent', () => {\n    const context = {\n      isGithubRepos: true,\n      repositoryUrl: 'https://github.com/kefranabg/readme-md-generator',\n      projectPrerequisites: [\n        { name: 'npm', value: '>=5.5.0' },\n        { name: 'node', value: '>= 9.3.0' }\n      ],\n      projectName: 'readme-md-generator',\n      projectVersion: '0.1.3',\n      projectDescription:\n        'Generates beautiful README files from git config & package.json infos',\n      projectDocumentationUrl:\n        'https://github.com/kefranabg/readme-md-generator#readme',\n      projectHomepage:\n        'https://github.com/kefranabg/readme-md-generator#readme',\n      projectDemoUrl: 'https://github.com/kefranabg/readme-md-generator#-demo',\n      authorName: 'Franck Abgrall',\n      authorWebsite: 'https://www.franck-abgrall.me/',\n      authorGithubUsername: 'kefranabg',\n      authorTwitterUsername: 'FranckAbgrall',\n      authorLinkedInUsername: 'franckabgrall',\n      authorPatreonUsername: 'FranckAbgrall',\n      licenseName: 'MIT',\n      licenseUrl:\n        'https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE',\n      issuesUrl: 'https://github.com/kefranabg/readme-md-generator/issues',\n      contributingUrl:\n        'https://github.com/kefranabg/readme-md-generator/blob/master/CONTRIBUTING.md',\n      installCommand: 'npm install',\n      usage: 'npm start',\n      testCommand: 'npm run test',\n      isProjectOnNpm: true\n    }\n\n    afterEach(() => {\n      jest.clearAllMocks()\n    })\n\n    it('should call ora with correct parameters in success case', async () => {\n      await buildReadmeContent(context, defaultTemplatePath)\n\n      expect(ora).toHaveBeenCalledTimes(1)\n      expect(ora).toHaveBeenCalledWith('Loading README template')\n      expect(succeed).toHaveBeenCalledTimes(1)\n      expect(succeed).toHaveBeenCalledWith('README template loaded')\n    })\n\n    it('should return readme default template content', async () => {\n      const result = await buildReadmeContent(context, defaultTemplatePath)\n\n      expect(result).toMatchSnapshot()\n    })\n\n    it('should return readme default template no html content', async () => {\n      const result = await buildReadmeContent(\n        context,\n        defaultNoHtmlTemplatePath\n      )\n\n      expect(result).toMatchSnapshot()\n    })\n\n    it('should call ora with correct parameters in fail case', async () => {\n      fs.readFile = jest.fn(() => {\n        throw new Error('error')\n      })\n\n      try {\n        await buildReadmeContent(context, defaultTemplatePath)\n        // eslint-disable-next-line no-empty\n      } catch (err) {}\n\n      expect(ora).toHaveBeenCalledTimes(1)\n      expect(ora).toHaveBeenCalledWith('Loading README template')\n      expect(fail).toHaveBeenCalledTimes(1)\n      expect(fail).toHaveBeenCalledWith('README template loading fail')\n    })\n  })\n\n  describe('getReadmeTemplatePath', () => {\n    it('should return template that user has selected', async () => {\n      const useDefaultAnswers = false\n      const actualResult = await getReadmeTemplatePath(\n        undefined,\n        useDefaultAnswers\n      )\n\n      expect(actualResult).toEqual(defaultTemplatePath)\n      expect(chooseTemplate).toHaveBeenNthCalledWith(1, useDefaultAnswers)\n    })\n\n    it('should return custom template path if customTemplatePath is defined', async () => {\n      const customTemplatePath = defaultTemplatePath\n\n      const actualResult = await getReadmeTemplatePath(\n        customTemplatePath,\n        false\n      )\n\n      expect(actualResult).toEqual(customTemplatePath)\n      expect(chooseTemplate).not.toHaveBeenCalled()\n    })\n\n    it('should throw an error if customTemplate is defined but invalid', () => {\n      const wrongPath = 'wrong path'\n\n      expect(getReadmeTemplatePath(wrongPath, false)).rejects.toThrow()\n    })\n\n    it('should call ora with correct parameters in fail case', async () => {\n      const wrongPath = 'wrong path'\n\n      try {\n        await getReadmeTemplatePath(wrongPath, false)\n        // eslint-disable-next-line no-empty\n      } catch (err) {}\n\n      expect(ora).toHaveBeenNthCalledWith(1, 'Resolving README template path')\n      expect(fail).toHaveBeenNthCalledWith(\n        1,\n        \"The template path 'wrong path' is not valid.\"\n      )\n    })\n\n    it('should call ora with correct parameters in success case', async () => {\n      await getReadmeTemplatePath(defaultTemplatePath, false)\n\n      expect(ora).toHaveBeenNthCalledWith(1, 'Resolving README template path')\n      expect(succeed).toHaveBeenNthCalledWith(\n        1,\n        'README template path resolved'\n      )\n    })\n  })\n\n  describe('checkOverwrite', () => {\n    it('should return true if README does not exist', async () => {\n      fs.existsSync = jest.fn(p => p !== README_PATH)\n      expect(await checkOverwriteReadme()).toEqual(true)\n    })\n    it('should return true if README exist and user want to overwrite it', async () => {\n      fs.existsSync = jest.fn(p => p === README_PATH)\n      askOverwriteReadme.mockResolvedValue(true)\n      expect(await checkOverwriteReadme()).toEqual(true)\n    })\n    it('should return false if README exist and user dont want to overwrite it', async () => {\n      fs.existsSync = jest.fn(p => p === README_PATH)\n      askOverwriteReadme.mockResolvedValue(false)\n      expect(await checkOverwriteReadme()).toEqual(false)\n    })\n  })\n})\n\njest.mock('ora')\njest.mock('./choose-template')\njest.mock('./ask-overwrite')\n"
  },
  {
    "path": "src/utils.js",
    "content": "const loadJsonFile = require('load-json-file')\nconst isNil = require('lodash/isNil')\nconst isEmpty = require('lodash/isEmpty')\nconst boxen = require('boxen')\nconst path = require('path')\nconst getReposName = require('git-repo-name')\nconst fetch = require('node-fetch')\nconst fs = require('fs')\nconst escapeMarkdown = require('markdown-escape')\nconst { execSync } = require('child_process')\n\nconst END_MSG = `README.md was successfully generated.\nThanks for using readme-md-generator!`\n\nconst GITHUB_API_URL = 'https://api.github.com'\n\nconst BOXEN_CONFIG = {\n  padding: 1,\n  margin: { top: 2, bottom: 3 },\n  borderColor: 'cyan',\n  align: 'center',\n  borderStyle: 'double'\n}\n\n/**\n * Display end message\n */\nconst showEndMessage = () => process.stdout.write(boxen(END_MSG, BOXEN_CONFIG))\n\n/**\n * Get package json name property\n *\n * @param {Object} packageJson\n */\nconst getPackageJsonName = (packageJson = {}) => packageJson.name || undefined\n/**\n * Get git repository name\n *\n * @param {String} cwd\n */\nconst getGitRepositoryName = cwd => {\n  try {\n    return getReposName.sync({ cwd })\n    // eslint-disable-next-line no-empty\n  } catch (err) {\n    return undefined\n  }\n}\n\n/**\n * Get project name\n */\nconst getProjectName = packageJson => {\n  const cwd = process.cwd()\n  return (\n    getPackageJsonName(packageJson) ||\n    getGitRepositoryName(cwd) ||\n    path.basename(cwd)\n  )\n}\n\n/**\n * Get package.json content\n */\nconst getPackageJson = async () => {\n  try {\n    return await loadJsonFile('package.json')\n  } catch (err) {\n    return undefined\n  }\n}\n\n/**\n * Get the default answer depending on the question type\n *\n * @param {Object} question\n */\nconst getDefaultAnswer = async (question, answersContext) => {\n  if (question.when && !question.when(answersContext)) return undefined\n\n  switch (question.type) {\n    case 'input':\n      return typeof question.default === 'function'\n        ? question.default(answersContext)\n        : question.default || ''\n    case 'checkbox':\n      return question.choices\n        .filter(choice => choice.checked)\n        .map(choice => choice.value)\n    default:\n      return undefined\n  }\n}\n\n/**\n * Return true if the project is available on NPM, return false otherwise.\n *\n * @param projectName\n * @returns boolean\n */\nconst isProjectAvailableOnNpm = projectName => {\n  try {\n    execSync(`npm view ${projectName}`, { stdio: 'ignore' })\n    return true\n  } catch (err) {\n    return false\n  }\n}\n\n/**\n * Get default question's answers\n *\n * @param {Array} questions\n */\nconst getDefaultAnswers = questions =>\n  questions.reduce(async (answersContextProm, question) => {\n    const answersContext = await answersContextProm\n\n    return {\n      ...answersContext,\n      [question.name]: await getDefaultAnswer(question, answersContext)\n    }\n  }, Promise.resolve({}))\n\n/**\n * Clean social network username by removing the @ prefix and\n * escaping markdown characters\n *\n * @param input social network username input\n * @returns {*} escaped input without the prefix\n */\nconst cleanSocialNetworkUsername = input =>\n  escapeMarkdown(input.replace(/^@/, ''))\n\n/**\n * Get author's website from Github API\n *\n * @param {string} githubUsername\n * @returns {string} authorWebsite\n */\nconst getAuthorWebsiteFromGithubAPI = async githubUsername => {\n  try {\n    const userData = await fetch(\n      `${GITHUB_API_URL}/users/${githubUsername}`\n    ).then(res => res.json())\n    const authorWebsite = userData.blog\n    return isNil(authorWebsite) || isEmpty(authorWebsite)\n      ? undefined\n      : authorWebsite\n  } catch (err) {\n    return undefined\n  }\n}\n\n/**\n * Returns a boolean whether a file exists or not\n *\n * @param {String} filepath\n * @returns {Boolean}\n */\nconst doesFileExist = filepath => {\n  try {\n    return fs.existsSync(filepath)\n  } catch (err) {\n    return false\n  }\n}\n\n/**\n * Returns the package manager from the lock file\n *\n * @returns {String} packageManger or undefined\n */\nconst getPackageManagerFromLockFile = () => {\n  const packageLockExists = doesFileExist('package-lock.json')\n  const yarnLockExists = doesFileExist('yarn.lock')\n\n  if (packageLockExists && yarnLockExists) return undefined\n  if (packageLockExists) return 'npm'\n  if (yarnLockExists) return 'yarn'\n  return undefined\n}\n\nmodule.exports = {\n  getPackageJson,\n  showEndMessage,\n  getProjectName,\n  END_MSG,\n  BOXEN_CONFIG,\n  getDefaultAnswers,\n  getDefaultAnswer,\n  cleanSocialNetworkUsername,\n  isProjectAvailableOnNpm,\n  getAuthorWebsiteFromGithubAPI,\n  getPackageManagerFromLockFile,\n  doesFileExist\n}\n"
  },
  {
    "path": "src/utils.spec.js",
    "content": "const loadJsonFile = require('load-json-file')\nconst boxen = require('boxen')\nconst path = require('path')\nconst getReposName = require('git-repo-name')\nconst fetch = require('node-fetch')\nconst fs = require('fs')\nconst { isNil } = require('lodash')\n\nconst realPathBasename = path.basename\nconst realGetReposNameSync = getReposName.sync\n\nconst {\n  getPackageJson,\n  showEndMessage,\n  getProjectName,\n  END_MSG,\n  BOXEN_CONFIG,\n  getDefaultAnswer,\n  getDefaultAnswers,\n  cleanSocialNetworkUsername,\n  isProjectAvailableOnNpm,\n  getAuthorWebsiteFromGithubAPI,\n  doesFileExist,\n  getPackageManagerFromLockFile\n} = require('./utils')\n\njest.mock('load-json-file')\njest.mock('boxen')\njest.mock('node-fetch')\njest.mock('fs')\n\ndescribe('utils', () => {\n  describe('getPackageJson', () => {\n    const packageJsonContent = {\n      name: 'readme-md-cli'\n    }\n\n    it('should return package.json content', async () => {\n      loadJsonFile.mockReturnValueOnce(Promise.resolve(packageJsonContent))\n\n      const result = await getPackageJson()\n\n      expect(result).toEqual(packageJsonContent)\n    })\n\n    it('should return undefined', async () => {\n      loadJsonFile.mockImplementationOnce(() => {\n        throw new Error('ERROR')\n      })\n\n      const result = await getPackageJson()\n\n      expect(result).toBeUndefined()\n    })\n  })\n\n  describe('showEndMessage', () => {\n    boxen.mockReturnValue(END_MSG)\n\n    it('should call boxen with correct parameters', () => {\n      showEndMessage()\n\n      expect(boxen).toHaveBeenCalledTimes(1)\n      expect(boxen).toHaveBeenCalledWith(END_MSG, BOXEN_CONFIG)\n    })\n\n    it('should call process.stdout.write with correct parameters', () => {\n      process.stdout.write = jest.fn()\n\n      showEndMessage()\n\n      expect(process.stdout.write).toHaveBeenCalledTimes(1)\n      expect(process.stdout.write).toHaveBeenCalledWith(END_MSG)\n    })\n  })\n\n  describe('getProjectName', () => {\n    const projectName = 'readme-md-generator'\n\n    beforeEach(() => {\n      path.basename = jest.fn(() => projectName)\n      getReposName.sync = jest.fn()\n    })\n\n    afterEach(() => {\n      path.basename = realPathBasename\n      getReposName.sync = realGetReposNameSync\n    })\n\n    it('should return package.json name prop when defined', () => {\n      const packageJson = { name: projectName }\n      getReposName.sync.mockReturnValueOnce('readme-md-generator')\n\n      const result = getProjectName(packageJson)\n\n      expect(result).toEqual(projectName)\n      expect(getReposName.sync).not.toHaveBeenCalled()\n      expect(path.basename).not.toHaveBeenCalled()\n    })\n\n    it('should return git repos when package.json it is not defined', () => {\n      const packageJson = undefined\n      getReposName.sync.mockReturnValueOnce('readme-md-generator')\n\n      const result = getProjectName(packageJson)\n\n      expect(result).toEqual(projectName)\n      expect(getReposName.sync).toHaveBeenCalled()\n      expect(path.basename).not.toHaveBeenCalled()\n    })\n\n    it('should return folder basename when package.json and git repos name is undefined', () => {\n      const packageJson = undefined\n      getReposName.sync.mockImplementation(() => {\n        throw new Error('error')\n      })\n\n      const result = getProjectName(packageJson)\n\n      expect(result).toEqual(projectName)\n      expect(getReposName.sync).toHaveBeenCalled()\n      expect(path.basename).toHaveBeenCalled()\n    })\n  })\n\n  describe('getDefaultAnswer', () => {\n    it('should handle input prompts correctly', async () => {\n      const question = { type: 'input', default: 'default' }\n      const result = await getDefaultAnswer(question)\n      expect(result).toEqual(question.default)\n    })\n\n    it('should handle choices prompts correctly', async () => {\n      const value = { name: 'name', value: 'value' }\n      const question = {\n        type: 'checkbox',\n        choices: [{ value, checked: true }, { checked: false }]\n      }\n      const result = await getDefaultAnswer(question)\n\n      expect(result).toEqual([value])\n    })\n\n    it('should return empty string for non-defaulted fields', async () => {\n      const question = { type: 'input' }\n      const result = await getDefaultAnswer(question)\n\n      expect(result).toEqual('')\n    })\n\n    it('should return undefined for invalid types', async () => {\n      const question = { type: 'invalid' }\n      const result = await getDefaultAnswer(question)\n\n      expect(result).toEqual(undefined)\n    })\n\n    it('should return undefined if when function is defined and return false', async () => {\n      const answersContext = {}\n      const question = {\n        type: 'input',\n        when: ansewersContext => !isNil(ansewersContext.licenseUrl)\n      }\n\n      const result = await getDefaultAnswer(question, answersContext)\n\n      expect(result).toEqual(undefined)\n    })\n\n    describe('isProjectAvailableOnNpm', () => {\n      it('should return true if project is available on npm', () => {\n        const result = isProjectAvailableOnNpm('readme-md-generator')\n\n        expect(result).toBe(true)\n      })\n\n      it('should return false if project is not available on npm', () => {\n        const result = isProjectAvailableOnNpm('bento-starter')\n\n        expect(result).toBe(false)\n      })\n    })\n\n    it('should return correct value if when function is defined and return true', async () => {\n      const answersContext = { licenseUrl: 'licenseUrl' }\n      const question = {\n        type: 'input',\n        default: 'default',\n        when: ansewersContext => !isNil(ansewersContext.licenseUrl)\n      }\n\n      const result = await getDefaultAnswer(question, answersContext)\n\n      expect(result).toEqual('default')\n    })\n  })\n\n  describe('getDefaultAnswers', () => {\n    it('should return default answers from questions', async () => {\n      const questions = [\n        {\n          type: 'input',\n          name: 'questionOne',\n          default: 'answer 1'\n        },\n        {\n          type: 'input',\n          name: 'questionTwo',\n          default: 'answer 2'\n        }\n      ]\n\n      const result = await getDefaultAnswers(questions)\n\n      expect(result).toEqual({\n        questionOne: 'answer 1',\n        questionTwo: 'answer 2'\n      })\n    })\n  })\n\n  describe('cleanSocialNetworkUsername', () => {\n    it('should remove prefixed @', () => {\n      expect(cleanSocialNetworkUsername('@Slashgear')).toEqual('Slashgear')\n    })\n\n    it('should escape markdown characters', () => {\n      expect(cleanSocialNetworkUsername('Slashgear__')).toEqual(\n        'Slashgear\\\\_\\\\_'\n      )\n      expect(cleanSocialNetworkUsername('Slashgear**')).toEqual(\n        'Slashgear\\\\*\\\\*'\n      )\n    })\n\n    it('should return the same string when string is not prefixed or contains markdown chars', () => {\n      expect(cleanSocialNetworkUsername('Slashgear')).toEqual('Slashgear')\n    })\n  })\n\n  describe('getAuthorWebsiteFromGithubAPI', () => {\n    it('should return author website url when it exists', async () => {\n      const expectedAuthorWebsite = 'https://www.franck-abgrall.me/'\n      fetch.mockReturnValueOnce(\n        Promise.resolve({\n          json: () => Promise.resolve({ blog: expectedAuthorWebsite })\n        })\n      )\n\n      const githubUsername = 'kefranabg'\n      const authorWebsite = await getAuthorWebsiteFromGithubAPI(githubUsername)\n      expect(authorWebsite).toEqual(expectedAuthorWebsite)\n    })\n\n    it('should return undefined if author website url does not exist', async () => {\n      fetch.mockReturnValueOnce(Promise.resolve({ blog: '' }))\n      const githubUsername = 'kefranabg'\n      const authorWebsite = await getAuthorWebsiteFromGithubAPI(githubUsername)\n      expect(authorWebsite).toEqual(undefined)\n    })\n\n    it('should return undefined if there is an error', async () => {\n      fetch.mockImplementationOnce(() => {\n        throw new Error('ERROR')\n      })\n      const githubUsername = 'kefranabg'\n      const authorWebsite = await getAuthorWebsiteFromGithubAPI(githubUsername)\n      expect(authorWebsite).toEqual(undefined)\n    })\n  })\n\n  describe('doesFileExist', () => {\n    it('should return true when file exists for a given path', () => {\n      fs.existsSync.mockReturnValueOnce(true)\n      expect(doesFileExist('./file-path')).toBe(true)\n    })\n\n    it('should return false when file does not exist for a given path', () => {\n      fs.existsSync.mockReturnValueOnce(false)\n      expect(doesFileExist('./file-path')).toBe(false)\n    })\n\n    it('should return false if fs.existsSync throws an error', () => {\n      fs.existsSync.mockImplementationOnce(() => {\n        throw new Error('ERROR')\n      })\n      expect(doesFileExist('./file-path')).toBe(false)\n    })\n  })\n\n  describe('getPackageManagerFromLockFile', () => {\n    it('should return npm if only package-lock.json exists', () => {\n      fs.existsSync.mockImplementation(\n        filePath => filePath === 'package-lock.json'\n      )\n\n      const result = getPackageManagerFromLockFile()\n\n      expect(result).toEqual('npm')\n    })\n\n    it('should return yarn if only yarn.lock exists', () => {\n      fs.existsSync.mockImplementation(filePath => filePath === 'yarn.lock')\n\n      const result = getPackageManagerFromLockFile()\n\n      expect(result).toEqual('yarn')\n    })\n\n    it('should return undefined if only yarn.lock and package-lock.json exists', () => {\n      fs.existsSync.mockImplementation(\n        filePath => filePath === 'yarn.lock' || filePath === 'package-lock.json'\n      )\n\n      const result = getPackageManagerFromLockFile()\n\n      expect(result).toBeUndefined()\n    })\n\n    it('should return undefined if only no lock file exists', () => {\n      fs.existsSync.mockImplementation(() => false)\n\n      const result = getPackageManagerFromLockFile()\n\n      expect(result).toBeUndefined()\n    })\n  })\n})\n"
  },
  {
    "path": "templates/default-no-html.md",
    "content": "# Welcome to <%= projectName %> 👋\n<% if (isProjectOnNpm) { -%>\n[![Version](https://img.shields.io/npm/v/<%= projectName %>.svg)](https://www.npmjs.com/package/<%= projectName %>)\n<% } -%>\n<% if (projectVersion && !isProjectOnNpm) { -%>\n![Version](https://img.shields.io/badge/version-<%= projectVersion %>-blue.svg?cacheSeconds=2592000)\n<% } -%>\n<% if (projectPrerequisites) { -%>\n<% projectPrerequisites.map(({ name, value }) => { -%>\n![Prerequisite](https://img.shields.io/badge/<%= name %>-<%= encodeURIComponent(value) %>-blue.svg)\n<% }) -%>\n<% } -%>\n<% if (projectDocumentationUrl) { -%>\n[![Documentation](https://img.shields.io/badge/documentation-yes-brightgreen.svg)](<%= projectDocumentationUrl %>)\n<% } -%>\n<% if (isGithubRepos) { -%>\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](<%= repositoryUrl %>/graphs/commit-activity)\n<% } -%>\n<% if (licenseName) { -%>\n[![License: <%= licenseName %>](https://img.shields.io/<%= isGithubRepos ? `github/license/${authorGithubUsername}/${projectName}` : `badge/License-${licenseName}-yellow.svg` %>)](<%= licenseUrl ? licenseUrl : '#' %>)\n<% } -%>\n<% if (authorTwitterUsername) { -%>\n[![Twitter: <%= authorTwitterUsername %>](https://img.shields.io/twitter/follow/<%= authorTwitterUsername %>.svg?style=social)](https://twitter.com/<%= authorTwitterUsername %>)\n<% } -%>\n<% if (projectDescription) { -%>\n\n> <%= projectDescription %>\n<% } -%>\n<% if (projectHomepage) { -%>\n\n### 🏠 [Homepage](<%= projectHomepage %>)\n<% } -%>\n<% if (projectDemoUrl) { -%>\n\n### ✨ [Demo](<%= projectDemoUrl %>)\n<% } -%>\n<% if (projectPrerequisites && projectPrerequisites.length) { -%>\n\n## Prerequisites\n\n<% projectPrerequisites.map(({ name, value }) => { -%>\n- <%= name %> <%= value %>\n<% }) -%>\n<% } -%>\n<% if (installCommand) { -%>\n\n## Install\n\n```sh\n<%= installCommand %>\n```\n<% } -%>\n<% if (usage) { -%>\n\n## Usage\n\n```sh\n<%= usage %>\n```\n<% } -%>\n<% if (testCommand) { -%>\n\n## Run tests\n\n```sh\n<%= testCommand %>\n```\n<% } -%>\n<% if (authorName || authorTwitterUsername || authorGithubUsername) { -%>\n\n## Author\n<% if (authorName) { %>\n👤 **<%= authorName %>**\n<% } %>\n<% if (authorWebsite) { -%>\n* Website: <%= authorWebsite %>\n<% } -%>\n<% if (authorTwitterUsername) { -%>\n* Twitter: [@<%= authorTwitterUsername %>](https://twitter.com/<%= authorTwitterUsername %>)\n<% } -%>\n<% if (authorGithubUsername) { -%>\n* GitHub: [@<%= authorGithubUsername %>](https://github.com/<%= authorGithubUsername %>)\n<% } -%>\n<% if (authorLinkedInUsername) { -%>\n* LinkedIn: [@<%= authorLinkedInUsername %>](https://linkedin.com/in/<%= authorLinkedInUsername %>)\n<% } -%>\n<% } -%>\n<% if (issuesUrl) { -%>\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!\n\nFeel free to check [issues page](<%= issuesUrl %>). <%= contributingUrl ? `You can also take a look at the [contributing guide](${contributingUrl}).` : '' %>\n<% } -%>\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n<% if (authorPatreonUsername) { -%>\n\n[![support us](https://img.shields.io/badge/become-a patreon%20us-orange.svg?cacheSeconds=2592000)](https://www.patreon.com/<%= authorPatreonUsername %>)\n<% } -%>\n\n<% if (licenseName && licenseUrl) { -%>\n\n## 📝 License\n\n<% if (authorName && authorGithubUsername) { -%>\nCopyright © <%= currentYear %> [<%= authorName %>](https://github.com/<%= authorGithubUsername %>).\n\n<% } -%>\nThis project is [<%= licenseName %>](<%= licenseUrl %>) licensed.\n<% } -%>\n\n***\n<%- include('footer.md'); -%>\n"
  },
  {
    "path": "templates/default.md",
    "content": "<h1 align=\"center\">Welcome to <%= projectName %> 👋</h1>\n<p>\n<% if (isProjectOnNpm) { -%>\n  <a href=\"https://www.npmjs.com/package/<%= projectName %>\" target=\"_blank\">\n    <img alt=\"Version\" src=\"https://img.shields.io/npm/v/<%= projectName %>.svg\">\n  </a>\n<% } -%>\n<% if (projectVersion && !isProjectOnNpm) { -%>\n  <img alt=\"Version\" src=\"https://img.shields.io/badge/version-<%= projectVersion %>-blue.svg?cacheSeconds=2592000\" />\n<% } -%>\n<% if (projectPrerequisites) { -%>\n<% projectPrerequisites.map(({ name, value }) => { -%>\n  <img src=\"https://img.shields.io/badge/<%= name %>-<%= encodeURIComponent(value) %>-blue.svg\" />\n<% }) -%>\n<% } -%>\n<% if (projectDocumentationUrl) { -%>\n  <a href=\"<%= projectDocumentationUrl %>\" target=\"_blank\">\n    <img alt=\"Documentation\" src=\"https://img.shields.io/badge/documentation-yes-brightgreen.svg\" />\n  </a>\n<% } -%>\n<% if (isGithubRepos) { -%>\n  <a href=\"<%= repositoryUrl %>/graphs/commit-activity\" target=\"_blank\">\n    <img alt=\"Maintenance\" src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg\" />\n  </a>\n<% } -%>\n<% if (licenseName) { -%>\n  <a href=\"<%= licenseUrl ? licenseUrl : '#' %>\" target=\"_blank\">\n    <img alt=\"License: <%= licenseName %>\" src=\"https://img.shields.io/<%= isGithubRepos ? `github/license/${authorGithubUsername}/${projectName}` : `badge/License-${licenseName}-yellow.svg` %>\" />\n  </a>\n<% } -%>\n<% if (authorTwitterUsername) { -%>\n  <a href=\"https://twitter.com/<%= authorTwitterUsername %>\" target=\"_blank\">\n    <img alt=\"Twitter: <%= authorTwitterUsername %>\" src=\"https://img.shields.io/twitter/follow/<%= authorTwitterUsername %>.svg?style=social\" />\n  </a>\n<% } -%>\n</p>\n<% if (projectDescription) { -%>\n\n> <%= projectDescription %>\n<% } -%>\n<% if (projectHomepage) { -%>\n\n### 🏠 [Homepage](<%= projectHomepage %>)\n<% } -%>\n<% if (projectDemoUrl) { -%>\n\n### ✨ [Demo](<%= projectDemoUrl %>)\n<% } -%>\n<% if (projectPrerequisites && projectPrerequisites.length) { -%>\n\n## Prerequisites\n\n<% projectPrerequisites.map(({ name, value }) => { -%>\n- <%= name %> <%= value %>\n<% }) -%>\n<% } -%>\n<% if (installCommand) { -%>\n\n## Install\n\n```sh\n<%= installCommand %>\n```\n<% } -%>\n<% if (usage) { -%>\n\n## Usage\n\n```sh\n<%= usage %>\n```\n<% } -%>\n<% if (testCommand) { -%>\n\n## Run tests\n\n```sh\n<%= testCommand %>\n```\n<% } -%>\n<% if (authorName || authorTwitterUsername || authorGithubUsername) { -%>\n\n## Author\n<% if (authorName) { %>\n👤 **<%= authorName %>**\n<% } %>\n<% if (authorWebsite) { -%>\n* Website: <%= authorWebsite %>\n<% } -%>\n<% if (authorTwitterUsername) { -%>\n* Twitter: [@<%= authorTwitterUsername %>](https://twitter.com/<%= authorTwitterUsername %>)\n<% } -%>\n<% if (authorGithubUsername) { -%>\n* GitHub: [@<%= authorGithubUsername %>](https://github.com/<%= authorGithubUsername %>)\n<% } -%>\n<% if (authorLinkedInUsername) { -%>\n* LinkedIn: [@<%= authorLinkedInUsername %>](https://linkedin.com/in/<%= authorLinkedInUsername %>)\n<% } -%>\n<% } -%>\n<% if (issuesUrl) { -%>\n\n## 🤝 Contributing\n\nContributions, issues and feature requests are welcome!<br />Feel free to check [issues page](<%= issuesUrl %>). <%= contributingUrl ? `You can also take a look at the [contributing guide](${contributingUrl}).` : '' %>\n<% } -%>\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n<% if (authorPatreonUsername) { -%>\n\n<a href=\"https://www.patreon.com/<%= authorPatreonUsername %>\">\n  <img src=\"https://c5.patreon.com/external/logo/become_a_patron_button@2x.png\" width=\"160\">\n</a>\n<% } -%>\n<% if (licenseName && licenseUrl) { -%>\n\n## 📝 License\n\n<% if (authorName && authorGithubUsername) { -%>\nCopyright © <%= currentYear %> [<%= authorName %>](https://github.com/<%= authorGithubUsername %>).<br />\n<% } -%>\nThis project is [<%= licenseName %>](<%= licenseUrl %>) licensed.\n<% } -%>\n\n***\n<%- include('footer.md'); -%>\n"
  },
  {
    "path": "templates/footer.md",
    "content": "_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_"
  }
]