{"id":21356182,"url":"https://github.com/jbenner-radham/node-readme-md","last_synced_at":"2025-07-12T22:33:32.674Z","repository":{"id":57348745,"uuid":"90555823","full_name":"jbenner-radham/node-readme-md","owner":"jbenner-radham","description":"A README.md generator library.","archived":false,"fork":false,"pushed_at":"2024-11-22T21:31:24.000Z","size":438,"stargazers_count":0,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T21:48:13.988Z","etag":null,"topics":["commonmark","docs","documentation","generator","markdown","md","readme"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbenner-radham.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-07T19:17:21.000Z","updated_at":"2024-11-22T21:31:28.000Z","dependencies_parsed_at":"2024-11-22T01:24:40.981Z","dependency_job_id":"551f6c2a-58d2-415c-a8be-91e8bc13db61","html_url":"https://github.com/jbenner-radham/node-readme-md","commit_stats":{"total_commits":152,"total_committers":2,"mean_commits":76.0,"dds":"0.013157894736842146","last_synced_commit":"ae7c6f4f85fd81ec147f3f117bf7ee77ddc880d7"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/jbenner-radham/node-readme-md","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbenner-radham%2Fnode-readme-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbenner-radham%2Fnode-readme-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbenner-radham%2Fnode-readme-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbenner-radham%2Fnode-readme-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbenner-radham","download_url":"https://codeload.github.com/jbenner-radham/node-readme-md/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbenner-radham%2Fnode-readme-md/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265066118,"owners_count":23706062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commonmark","docs","documentation","generator","markdown","md","readme"],"created_at":"2024-11-22T04:29:20.827Z","updated_at":"2025-07-12T22:33:32.391Z","avatar_url":"https://github.com/jbenner-radham.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"readme-md\n=========\n[![npm Version][NPM VERSION BADGE]][NPM PAGE]\n[![Node.js][NODE VERSION BADGE]][NODE PAGE]\n[![GitHub License][LICENSE BADGE]][LICENSE PAGE]\n[![CI Status][CI BADGE]][CI PAGE]\n\nA `README.md` generator library.\n\nInstall\n-------\n```shell\nyarn add readme-md # Or alternatively: `npm install readme-md`\n```\n\nUsage\n-----\n**NOTE**: This library exports both [CJS](https://nodejs.org/api/modules.html) and [ESM](https://nodejs.org/api/esm.html) modules.\n\n### JavaScript (Basic)\n```javascript\nimport readme from 'readme-md';\n\nconst pkg = {\n    name: 'my-awesome-package',\n    description: 'An awesome package.',\n    type: 'module',\n    license: 'MIT',\n    scripts: {\n        test: 'jest'\n    }\n};\n\nreadme({ pkg });\n// \u003e my-awesome-package\n// \u003e ==================\n// \u003e An awesome package.\n// \u003e\n// \u003e Install\n// \u003e -------\n// \u003e ```sh\n// \u003e npm install my-awesome-package\n// \u003e ```\n// \u003e\n// \u003e Usage\n// \u003e -----\n// \u003e ```js\n// \u003e import myAwesomePackage from 'my-awesome-package';\n// \u003e ```\n// \u003e\n// \u003e Testing\n// \u003e -------\n// \u003e ```sh\n// \u003e npm test\n// \u003e ```\n// \u003e\n// \u003e License\n// \u003e -------\n// \u003e The MIT License. See the license file for details.\n```\n\n### JavaScript (Advanced)\n```javascript\nimport readme from 'readme-md';\n\nconst pkg = {\n    name: 'my-awesome-package',\n    description: 'An awesome package.',\n    type: 'module',\n    license: 'MIT',\n    scripts: {\n        test: 'jest'\n    },\n    engines: {\n        yarn: '1.x'\n    }\n};\n\nconst additionalSections = [\n    {\n        position: 'before:Install',\n        title: 'Greetings',\n        body: 'Hello world!'\n    }\n];\n\nconst badges = [\n    {\n        alt: 'Build Status',\n        image: 'https://img.shields.io/github/actions/workflow/status/jbenner-radham/node-readme-md/ci.yaml?branch=main\u0026logo=github\u0026style=flat',\n        link: 'https://github.com/jbenner-radham/node-readme-md/actions/workflows/ci.yaml'\n    }\n];\n\nconst licenseLink = 'LICENSE';\n\nreadme({ pkg, additionalSections, badges, licenseLink });\n// \u003e my-awesome-package\n// \u003e ==================\n// \u003e [![Build Status](https://img.shields.io/github/actions/workflow/status/jbenner-radham/node-readme-md/ci.yaml?branch=main\u0026logo=github\u0026style=flat)](https://github.com/jbenner-radham/node-readme-md/actions/workflows/ci.yaml)\n// \u003e\n// \u003e An awesome package.\n// \u003e\n// \u003e Greetings\n// \u003e ---------\n// \u003e Hello world!\n// \u003e\n// \u003e Install\n// \u003e -------\n// \u003e ```sh\n// \u003e yarn add my-awesome-package # Or alternatively: `npm install my-awesome-package`\n// \u003e ```\n// \u003e\n// \u003e Usage\n// \u003e -----\n// \u003e ```js\n// \u003e import myAwesomePackage from 'my-awesome-package';\n// \u003e ```\n// \u003e\n// \u003e Testing\n// \u003e -------\n// \u003e ```sh\n// \u003e yarn test # Or alternatively: `npm test`\n// \u003e ```\n// \u003e\n// \u003e License\n// \u003e -------\n// \u003e The MIT License. See the [license file](LICENSE) for details.\n```\n\n### TypeScript (Advanced)\n```typescript\nimport readme, { type ReadmeConfig } from 'readme-md';\n\nconst config: ReadmeConfig = {\n    pkg: {\n        name: 'my-awesome-package',\n        description: 'An awesome package.',\n        type: 'module',\n        license: 'MIT',\n        scripts: {\n            test: 'jest'\n        },\n        engines: {\n            yarn: '1.x'\n        }\n    },\n    additionalSections: [\n        {\n            position: 'before:Install',\n            title: 'Greetings',\n            body: 'Hello world!'\n        }\n    ],\n    badges: [\n        {\n            alt: 'Build Status',\n            image: 'https://img.shields.io/github/actions/workflow/status/jbenner-radham/node-readme-md/ci.yaml?branch=main\u0026logo=github\u0026style=flat',\n            link: 'https://github.com/jbenner-radham/node-readme-md/actions/workflows/ci.yaml'\n        }\n    ],\n    licenseLink: 'LICENSE'\n};\n\nreadme(config);\n// \u003e my-awesome-package\n// \u003e ==================\n// \u003e [![Build Status](https://img.shields.io/github/actions/workflow/status/jbenner-radham/node-readme-md/ci.yaml?branch=main\u0026logo=github\u0026style=flat)](https://github.com/jbenner-radham/node-readme-md/actions/workflows/ci.yaml)\n// \u003e\n// \u003e An awesome package.\n// \u003e\n// \u003e Greetings\n// \u003e ---------\n// \u003e Hello world!\n// \u003e\n// \u003e Install\n// \u003e -------\n// \u003e ```sh\n// \u003e yarn add my-awesome-package # Or alternatively: `npm install my-awesome-package`\n// \u003e ```\n// \u003e\n// \u003e Usage\n// \u003e -----\n// \u003e ```js\n// \u003e import myAwesomePackage from 'my-awesome-package';\n// \u003e ```\n// \u003e\n// \u003e Testing\n// \u003e -------\n// \u003e ```sh\n// \u003e yarn test # Or alternatively: `npm test`\n// \u003e ```\n// \u003e\n// \u003e License\n// \u003e -------\n// \u003e The MIT License. See the [license file](LICENSE) for details.\n```\n\nAPI\n---\n```typescript\nimport type { PackageJson } from 'type-fest';\n\n/**\n * Generates a readme document based upon the provided config.\n */\nexport default function readme(config?: ReadmeConfig): string;\n\nexport interface ReadmeConfig {\n    /**\n     * Additional sections to add to the readme.\n     */\n    additionalSections?: Section[];\n\n    /**\n     * Badges to add to the readme.\n     */\n    badges?: Badge[];\n\n    /**\n     * Add a hero image to the readme, below the description.\n     */\n    heroImage?: HeroImage;\n\n    /**\n     * While the license is derived from the `pkg.license` option this specifies\n     * a link target to the license itself. If defined as `true` it will default\n     * to setting the link target to \"LICENSE\". Please note that if\n     * `pkg.license` is not defined this setting will have no effect.\n     */\n    licenseLink?: boolean | string;\n\n    /**\n     * The contents of a `package.json` to parse to generate the readme.\n     */\n    pkg?: PackageJson;\n\n    /**\n     * Whether the package should be shown as being installed as a dev\n     * dependency in the \"Install\" section of the readme. Defaults to `false`.\n     */\n    preferDev?: boolean;\n\n    /**\n     * The package manager used in the \"Install\" and \"Testing\" sections defaults\n     * to npm. However, this can be changed by specifying a package manager\n     * (pnpm, Yarn) in `pkg.engines`. If desired set this to `true` to override\n     * any package manager specified and utilize npm. Defaults to `false`.\n     */\n    preferNpm?: boolean;\n\n    /**\n     * Whether the example code in the \"Usage\" section should be terminated by\n     * semicolons. Defaults to `true`.\n     */\n    preferSemicolons?: boolean;\n\n    /**\n     * The type of quotes used in the \"Usage\" section. Defaults to single\n     * quotes.\n     */\n    quoteType?: 'double' | 'single';\n\n    /**\n     * Override any of the default generated sections.\n     */\n    sectionOverrides?: SectionOverrides;\n}\n\nexport interface Section {\n    /**\n     * The position of the section in the readme. If not specified the section\n     * will be appended onto the end of the readme. If a number is specified it\n     * can be either positive or negative.\n     */\n    position?: number | PositionDirective;\n\n    /**\n     * The title of the section.\n     */\n    title: string;\n\n    /**\n     * The section body. If not specified it will default to the placeholder\n     * text.\n     */\n    body?: string;\n}\n\nexport interface HeroImage {\n    /**\n     * The image alt tag.\n     */\n    alt: string;\n\n    /**\n     * The image URL or path.\n     */\n    src: string;\n}\n\n/**\n * A `PositionDirective` is a string which begins with either \"before:\" or\n * \"after:\" and the section title to search for.\n *\n * @example\n * { position: 'after:Install' }\n * @example\n * { position: 'before:License' }\n */\nexport type PositionDirective = string;\n\nexport interface Badge {\n    /**\n     * The image alt tag.\n     */\n    alt: string;\n\n    /**\n     * The image URL.\n     */\n    image: string;\n\n    /**\n     * The link target of the image.\n     */\n    link: string;\n}\n\nexport interface SectionOverrides {\n    /**\n     * Override for the \"Install\" section body text.\n     */\n    install?: string;\n\n    /**\n     * Override for the \"Usage\" section body text.\n     */\n    usage?: string;\n\n    /**\n     * Override for the \"Testing\" section body text.\n     */\n    testing?: string;\n\n    /**\n     * Override for the \"License\" section body text.\n     */\n    license?: string;\n}\n```\n\n\nTesting\n-------\n```shell\nyarn test # Or alternatively: `npm test`\n```\n\nSee Also\n--------\n- [readme-md-cli @ npm](https://www.npmjs.com/package/readme-md-cli)\n\nLicense\n-------\nThe MIT License. See the [license file](LICENSE) for details.\n\n[CI BADGE]: https://github.com/jbenner-radham/node-readme-md/actions/workflows/ci.yaml/badge.svg\n[CI PAGE]: https://github.com/jbenner-radham/node-readme-md/actions/workflows/ci.yaml\n[LICENSE BADGE]: https://img.shields.io/badge/license-MIT%20License-blue.svg\n[LICENSE PAGE]: https://github.com/jbenner-radham/node-readme-md/blob/master/LICENSE\n[NODE PAGE]: https://nodejs.org/\n[NODE VERSION BADGE]: https://img.shields.io/node/v/readme-md.svg\n[NPM PAGE]: https://www.npmjs.com/package/readme-md\n[NPM VERSION BADGE]: https://img.shields.io/npm/v/readme-md.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbenner-radham%2Fnode-readme-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbenner-radham%2Fnode-readme-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbenner-radham%2Fnode-readme-md/lists"}