{"id":20551518,"url":"https://github.com/generate/best-practices","last_synced_at":"2026-03-06T21:32:22.154Z","repository":{"id":93328285,"uuid":"60884655","full_name":"generate/best-practices","owner":"generate","description":"Advice on creating effective generators and getting the most out of Generate.","archived":false,"fork":false,"pushed_at":"2016-06-13T17:53:51.000Z","size":1,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T02:03:08.040Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/generate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-06-11T00:47:36.000Z","updated_at":"2017-12-27T13:24:18.000Z","dependencies_parsed_at":"2023-03-05T15:15:13.334Z","dependency_job_id":null,"html_url":"https://github.com/generate/best-practices","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/generate/best-practices","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fbest-practices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fbest-practices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fbest-practices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fbest-practices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/generate","download_url":"https://codeload.github.com/generate/best-practices/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/generate%2Fbest-practices/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30198661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-16T02:31:54.123Z","updated_at":"2026-03-06T21:32:22.102Z","avatar_url":"https://github.com/generate.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Best Practices\n\nThis guide shows you how to get the most out of Generate! \n\n- create awesome generators\n- naming tasks\n- naming generators\n- micro-generators\n\n## Naming tasks\n\n**Prerequisites**\n\n- Basic understanding of [tasks]()\n- Basic understanding of [generators]()\n- Basic understanding of [plugins]()\n\n**Overview**\n\nUsing good naming practices ensures that your generator will not only be easier to use from the command line, but it will also be easier for other implementors to use your generator as a [sub-generator][] or [plugin][] in their own generators.\n\n [task documentation](), \n\nAliases are also useful for preventing task-naming conflicts in cases where generators are used as plugins, since it's possible for multiple generators to have the same task names. \n\nproviding an alternative name in cases where a generator might be used as a plugin by another generator, _both generators have a task with the same name_. \n\n\n```js\n// --- one.js ---\nmodule.exports = function(app) {\n  app.task('foo', function() {});\n  app.task('bar', function() {});\n  app.task('default', ['foo', 'bar']);\n};\n\n// --- two.js ---\nmodule.exports = function(app) {\n  // use generator `one` as a plugin, which adds tasks from\n  // `one` to this generator\n  app.use(require('./one'));\n\n  // the following tasks will overwrite the tasks from generator `one`\n  app.task('foo', function() {});\n  app.task('bar', function() {});\n  app.task('default', ['foo', 'bar']);\n};\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerate%2Fbest-practices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenerate%2Fbest-practices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerate%2Fbest-practices/lists"}