{"id":14036145,"url":"https://github.com/Mrcomputer1/PostCountProgressBar","last_synced_at":"2025-07-27T03:31:31.271Z","repository":{"id":2843413,"uuid":"43282026","full_name":"Mrcomputer1/PostCountProgressBar","owner":"Mrcomputer1","description":"Source code of Mrcomputer1's post count progress bar","archived":false,"fork":false,"pushed_at":"2023-10-19T09:40:52.000Z","size":2329,"stargazers_count":6,"open_issues_count":11,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-02T15:47:29.293Z","etag":null,"topics":["image-generator","nodejs","progress-bar"],"latest_commit_sha":null,"homepage":"https://mrcomputer1.github.io/PostCountProgressBar","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/Mrcomputer1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-09-28T05:39:36.000Z","updated_at":"2022-02-18T07:48:00.000Z","dependencies_parsed_at":"2023-02-18T08:16:03.907Z","dependency_job_id":"e983252c-c756-4742-baef-be379bdcd8c1","html_url":"https://github.com/Mrcomputer1/PostCountProgressBar","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Mrcomputer1/PostCountProgressBar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mrcomputer1%2FPostCountProgressBar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mrcomputer1%2FPostCountProgressBar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mrcomputer1%2FPostCountProgressBar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mrcomputer1%2FPostCountProgressBar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mrcomputer1","download_url":"https://codeload.github.com/Mrcomputer1/PostCountProgressBar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mrcomputer1%2FPostCountProgressBar/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267294180,"owners_count":24065343,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["image-generator","nodejs","progress-bar"],"created_at":"2024-08-12T03:01:51.013Z","updated_at":"2025-07-27T03:31:30.972Z","avatar_url":"https://github.com/Mrcomputer1.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Post Count Progress Bar\nSource code of Mrcomputer1's Post Count Progress Bar version 2 (see master-1.x for version 1 in PHP).\n\n# API\n\n```js\nconst done = 50;\nconst goal = 100;\n\nconst bar = new progressBar();\nbar.setProgress(done, goal)\n    .setUnit(\"posts\")\n    .use(new progressBar.themes.default())\n    .use(new progressBar.generators.CanvasBigGenerator(\"#canvas\"));\n\n// Generate the bar into the canvas with\nbar.generate();\n\nbar.download(url =\u003e window.open(url));\n```\n\n## `progressBar.ProgressBar`\nNote: `new progressBar` will work the same as `new progressBar.ProgressBar`\n\n### `use(extension/theme/generator ext)`\nExtensions will be run before the generator.\n\nGenerators are used when `generate()` is called.\n\nThemes are used by the generator.\n\n### `setProgress(int done, int goal)`\n\n### `setUnit(String unit)`\n\n#### `generate()`\nRuns the generater.\n\n#### `download(Function callback)`\nGenerates a download link and returns it in the callback function.\n\n### `getDownloadExtension()`\nReturns the extension of the download file, with a `.`.\n\nFor example, the canvas generators return `.png` and the text generators return `.txt`\n\n## `progressBar.extension`\n\n### `run(ProgressBar bar)`\nCalled when ran.\n\n## `progressBar.theme`\n\n### `constructor()`\n```js\nsuper();\n\n// Your constructor should set the following to colours in hex format (#rrggbb).\nthis.background\nthis.incomplete\nthis.complete\nthis.text\n```\n\n## `progressBar.generator`\n\n### `constructor(String element)`\n```js\nsuper(element); // This will set `this.element`.\n```\n\n### `run(ProgressBar bar)`\nCalled when ran\n\n### `getSize()`\nThe exact size of the generated progress bar or null if no exact size.\n\n### `getDownloadLink(Function callback)`\nGenerates a download link for the progress bar.\n\n### `getDownloadExtension()`\nReturns the extension of the download.\n\n## `progressBar.canvasGenerator`\n\n### `constructor(String element)`\nThe constructor is not required. But if you do use it you must include `super(element);` at the top.\n\n### `run(ProgressBar bar)`\nCalled when ran\n\n### `getSize()`\nThe needed size of the canvas\n\n## `progressBar.generators`\n\n### `CanvasBigGenerator(String element)`\ndone/goal posts (100 lines) percent%\n\n`element` must be either a div element (which will be emptied and a canvas created inside) or a canvas.\n\n### `CanvasSmallGenerator(String element)`\ndone/goal posts (bar) percent%\n\n`element` must be either a div element (which will be emptied and a canvas created inside) or a canvas.\n\n### `CanvasBackgroundPosts(String element)`\nBackground is progress bar\n\nPosts count is on top\n\n`element` must be either a div element (which will be emptied and a canvas created inside) or a canvas.\n\n### `CanvasBackgroundPercent(String element)`\nBackground is progress bar\n\nPercent is on top\n\n`element` must be either a div element (which will be emptied and a canvas created inside) or a canvas.\n\n### `Text(String element)`\ndone/goal posts (bar) percent%.\n\nBackground and text colour are ignored for the text generator.\n\n## `progressBar.themes`\n\n### `default()`\nBlack background, white text, green complete lines, red incomplete lines\n\n### `white()`\nWhite background, black text, green complete lines, red incomplete lines\n\n### `blue()`\nBlue background, white text, green complete lines, red incomplete lines\n\n### `custom(background, complete, incomplete, text)`\nValues should be hex colour codes. (`#rrggbb`)\n\n## `progressBar.extensions`\n\n### `autoClear` **DEPRECATED**\nClear the canvas before generating. Only for use when generating to a canvas.\n\n**Deprecation Reason:** Canvas generators draw a background, which makes clearing the canvas pointless.\n\n### `autoSize`\nSet the canvas size before generating. Only for use when generating to a canvas.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMrcomputer1%2FPostCountProgressBar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMrcomputer1%2FPostCountProgressBar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMrcomputer1%2FPostCountProgressBar/lists"}