{"id":36500399,"url":"https://github.com/pregalaxyer/nemo","last_synced_at":"2026-01-12T02:20:08.443Z","repository":{"id":37092019,"uuid":"422428099","full_name":"pregalaxyer/nemo","owner":"pregalaxyer","description":"a 💪  typescript generator 🔨 for swagger resultful api, based on swagger v2 摸鱼\u0026代码量神器","archived":false,"fork":false,"pushed_at":"2022-06-25T03:01:44.000Z","size":627,"stargazers_count":26,"open_issues_count":2,"forks_count":8,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-19T21:47:00.317Z","etag":null,"topics":["api","codegen","interface","moy","nemo","pregalaxyer","swagger","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pregalaxyer.png","metadata":{"files":{"readme":"Readme.en.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":"2021-10-29T03:17:51.000Z","updated_at":"2024-01-08T02:50:40.000Z","dependencies_parsed_at":"2022-08-22T20:50:46.594Z","dependency_job_id":null,"html_url":"https://github.com/pregalaxyer/nemo","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/pregalaxyer/nemo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pregalaxyer%2Fnemo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pregalaxyer%2Fnemo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pregalaxyer%2Fnemo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pregalaxyer%2Fnemo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pregalaxyer","download_url":"https://codeload.github.com/pregalaxyer/nemo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pregalaxyer%2Fnemo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"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":["api","codegen","interface","moy","nemo","pregalaxyer","swagger","typescript"],"created_at":"2026-01-12T02:20:08.342Z","updated_at":"2026-01-12T02:20:08.418Z","avatar_url":"https://github.com/pregalaxyer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[简体中文](Readme.zh.md)\n\n\u003ch1 style=\"text-align: center\"\u003enemo🐠\u003c/h1\u003e\n\n\u003cdiv  style=\"text-align: center\"\u003e\n\u003cimg src=\"https://img.shields.io/npm/v/@pregalaxyer/nemo?color=%23\u0026style=plastic\" /\u003e\n\u003cimg src=\"https://img.shields.io/npm/l/@pregalaxyer/nemo\" /\u003e\n\u003cimg src=\"https://img.shields.io/github/workflow/status/pregalaxyer/nemo/Pull%20Request\"/\u003e\n\u003cimg src=\"https://img.shields.io/codecov/c/github/pregalaxyer/nemo?style=plastic\"/\u003e\n\u003cimg src=\"https://img.shields.io/npm/dm/@pregalaxyer/nemo?style=plastic\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/pkg--manage-pnpm-orange\"\u003e\n\u003c/div\u003e\n\n\u003cp  style=\"text-align: center\"\u003e a 💪 typescript generator 🔨 for swagger resultful api, based on swagger v2 \u003c/p\u003e\n\n\n\n\n## Install\n\n```node\n  npm install @pregalaxyer/nemo\n  // or\n  yarn add @pregalaxyer/nemo\n  // install global\n  npm install @pregalaxyer/nemo -g\n```\n\n## Example\nexcute the file below, your will get your swagger typescript files.\n\u003cb\u003eoptions\u003c/b\u003e:\n  \n  1. `url`: your resultful swagger json url\n  2. `output`: the folder for your swagger typescript files\n  3. `requestPath`: customer request, such as `axios`, `umi-request` or file path\n  4. `exportsRequest`: the options for your to decide wether create request folder, always happened when you want save local fetch changes\n  5. `paths`: exports by paths filter\n\n```typescript\n\ninterface SwaggerConfig {\n  /**\n   * @description swagger api url\n   */\n  url: string\n  /**\n   * @description single-api or apis\n   */\n  paths?: Array\u003cstring | Regexp\u003e\n  /**\n   * @description output floder\n   */\n  output?: string\n  /**\n   * @description where request module import from\n   */\n  requestPath?: string\n  /**\n   * @description request templates only create and remove when it is true\n   * when you only need exportsRequest once, mostly code likes:\n   * * `exportsRequest: !isRequestFloderExsit`\n   */\n  exportsRequest?: boolean\n}\n```\n`swagger.js`\n```node\nconst main = require('@pregalaxyer/nemo')\n\n// with esm\nimport main from '@pregalaxyer/nemo'\n\nmain({\n  url: 'https://petstore.swagger.io/v2/swagger.json',\n  output: './src/api'\n})\n\n```\n\n**Terminal Bash**\n\n``` bash\n@pregalaxyer/nemo convert -i https://petstore.swagger.io/v2/swagger.json -o ./src/api\n# or after install global\nnpx @pregalaxyer/nemo convert -i https://petstore.swagger.io/v2/swagger.json -o ./src/api\n\n```\n\n## Change request library\nIt easy for you to use other request library. Example:\n\n```typescript\ntype RequestInitWithoutBodyInit = Omit\u003cRequestInit, 'body'\u003e\n\ninterface Options extends RequestInitWithoutBodyInit, Record\u003cstring, any\u003e {\n  body?: Record\u003cstring, any\u003e\n  formData?: Record\u003cstring, any\u003e\n  query?: Record\u003cstring, any\u003e\n}\n// default request\nrequest\u003cResponseType\u003e(url: string, options: Options)\n\n\n// your request file\nimport request from `${library}`\nimport { getRequestBody, Options  } from `${output}/utils`\n\nexport default async function \u003cT\u003e(url, options) {\n  const body: BodyInit | undefined = getRequestBody(options)\n  const data = await request\u003cT\u003e(url, Object.assign(options, {body}))\n  return data\n}\n```\n\n\n\n\n\n\n## TODO\n- [ ] swagger v3 support\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpregalaxyer%2Fnemo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpregalaxyer%2Fnemo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpregalaxyer%2Fnemo/lists"}