{"id":15967924,"url":"https://github.com/magicdawn/create-with-generator","last_synced_at":"2026-04-03T23:04:53.040Z","repository":{"id":64181522,"uuid":"573387417","full_name":"magicdawn/create-with-generator","owner":"magicdawn","description":"use `pnpm create` / `yarn create` / `npm init` with yeoman generator","archived":false,"fork":false,"pushed_at":"2022-12-02T14:11:45.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-08T18:42:12.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/magicdawn.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}},"created_at":"2022-12-02T10:46:38.000Z","updated_at":"2023-08-05T22:12:09.000Z","dependencies_parsed_at":"2023-01-15T03:01:07.085Z","dependency_job_id":null,"html_url":"https://github.com/magicdawn/create-with-generator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicdawn%2Fcreate-with-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicdawn%2Fcreate-with-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicdawn%2Fcreate-with-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicdawn%2Fcreate-with-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicdawn","download_url":"https://codeload.github.com/magicdawn/create-with-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237332608,"owners_count":19292777,"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":[],"created_at":"2024-10-07T18:42:20.773Z","updated_at":"2025-10-20T12:30:39.431Z","avatar_url":"https://github.com/magicdawn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# create-with-generator\n\n\u003e use `pnpm create` / `yarn create` / `npm init` with yeoman generator\n\n[![Build Status](https://img.shields.io/github/workflow/status/magicdawn/create-with-generator/ci/main.svg?style=flat-square)](https://github.com/magicdawn/create-with-generator/actions/workflows/ci.yml)\n[![Coverage Status](https://img.shields.io/codecov/c/github/magicdawn/create-with-generator.svg?style=flat-square)](https://codecov.io/gh/magicdawn/create-with-generator)\n[![npm version](https://img.shields.io/npm/v/create-with-generator.svg?style=flat-square)](https://www.npmjs.com/package/create-with-generator)\n[![npm downloads](https://img.shields.io/npm/dm/create-with-generator.svg?style=flat-square)](https://www.npmjs.com/package/create-with-generator)\n[![npm license](https://img.shields.io/npm/l/create-with-generator.svg?style=flat-square)](http://magicdawn.mit-license.org)\n\n## Install\n\n```sh\n$ pnpm add create-with-generator\n```\n\n## API\n\n```js\nrequire('create-with-generator').runGenerator({ __dirname })\n```\n\n### options\n\n| key         | type     | required | description                                                                                                                                   |\n| ----------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |\n| `__dirname` | `string` | `true`   | your `__dirname`, used to detect who is calling `runGenerator`, if running in a symlinked environment, you need pass `__dirname` explicitly   |\n| `name`      | `string` | `false`  | generator name, can be bareName(like `augular` or `@scope/augular` ) or fullname name(like `generator-angular` or `@scope/generator-angular`) |\n| `subname`   | `string` | `false`  | generator subname, defaults empty, stands for `yo \u003cname\u003e:app`                                                                                 |\n\n## Usage Guide\n\nexample we have `generator-angular`, and we want to build the `create-angular` package\n\n- init package.json via `npm init`\n- install deps: `pnpm add create-with-generator 'generator-angular@*'`\n- add `index.js` with contents below\n- add `main` \u0026 `bin` field of package.json to `index.js`\n- tweak your package.json as you want, then run `npm publish`\n- start create using `pnpm create angular`\n\n### `index.js`\n\n```js\nrequire('create-with-generator').runGenerator({ __dirname })\n```\n\n### `package.json`\n\n```json\n{\n  \"main\": \"index.js\",\n  \"bin\": \"index.js\"\n}\n```\n\n## Changelog\n\n[CHANGELOG.md](CHANGELOG.md)\n\n## License\n\nthe MIT License http://magicdawn.mit-license.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicdawn%2Fcreate-with-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicdawn%2Fcreate-with-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicdawn%2Fcreate-with-generator/lists"}