a simple approach to badge management in any project (nodejs required)
- Styles: flat, classic (gradient)
- Hooks into single readme (no requirement for a "template" readme file)
npm install --save-dev badge-management
-
Include project to your
package.json
vianpm install --save-dev badge-management
-
Add to your
package.json
{ "badges": { "injectors": { "README.md": [ { "definitions": [ "repository", "version" ] } ] }, "definitions": { "version": { "type": "package_version" }, "repository": { "type": "package_repository_url" } } } }
injectors
are not required and can be removed.definitions
requires at least 1 entry.
-
If
injectors
is not defined skip to step 4.- In each file your injecting add these tags where you want the render to happen.
[comment_badge_management_start]: <hidden__do_not_remove> [comment_badge_management_end]: <hidden__do_not_remove>
-
Create a script wherever you would like with the following contents (for example we picked
./scripts/badges.js
.require("badge-management").run();
-
Execute that script with
node scripts/badges.js
to update your badge files and injectors (if defined).
more about configuration options can be found here