{"id":16293658,"url":"https://github.com/famanoder/eryue","last_synced_at":"2025-03-20T03:31:10.497Z","repository":{"id":14936112,"uuid":"77335956","full_name":"famanoder/eryue","owner":"famanoder","description":":cherries: A framework for full stack development of Nodejs for SMEs(small and medium-sized enterprises)！","archived":false,"fork":false,"pushed_at":"2023-01-03T21:01:59.000Z","size":617,"stargazers_count":10,"open_issues_count":9,"forks_count":0,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2024-04-14T14:54:45.488Z","etag":null,"topics":["decorator","dependency-injection","functional","koa","mvc","nodejs","smes"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/famanoder.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}},"created_at":"2016-12-25T17:22:55.000Z","updated_at":"2019-07-07T17:56:28.000Z","dependencies_parsed_at":"2023-01-13T18:11:37.004Z","dependency_job_id":null,"html_url":"https://github.com/famanoder/eryue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/famanoder%2Feryue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/famanoder%2Feryue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/famanoder%2Feryue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/famanoder%2Feryue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/famanoder","download_url":"https://codeload.github.com/famanoder/eryue/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244543792,"owners_count":20469562,"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":["decorator","dependency-injection","functional","koa","mvc","nodejs","smes"],"created_at":"2024-10-10T20:11:59.400Z","updated_at":"2025-03-20T03:31:10.209Z","avatar_url":"https://github.com/famanoder.png","language":"JavaScript","readme":"[![Build Status](https://travis-ci.org/famanoder/eryue.svg?branch=dev)](https://travis-ci.org/famanoder/eryue)\n\n\u003e  A framework for full stack development of Nodejs for SMEs(small and medium-sized enterprises)！\n\n### Usage\n\n-----\n\n* **Install**\n\n```js\nnpm i @eryue/core\n// or\nyarn add @eryue/core\n```\n\n* **Hello, world !**\n\n```js\nimport Eryue, {Router} from '@eryue/core';\n\n@Router.get({\n  greet: 'Hello, world !'\n})\nclass App extends Eryue {}\n\nnew App();\n\n// curl localhost:8000/greet\n// =\u003e Hello, world ! \n```\n\n### Decorators\n\n----- \n\n* **@Config(Object|String)**\n\nwe can bind our app's config from here, if option is String, we'll think it's a file and try to ensure it exists then require it as config, or just an Object, some time we can visit it by `cx.config`;\n\neg: \n\n```js\n@Config({\n  port: 1234\n})\n// or \n@Config('app.config.js')\n\n// app.config.js\nmodule.exports = {\n  port: 1234\n}\n```\n\n* all provided config items:\n\n```js\n{\n  // port: 8080,\n  // favicon: '',\n  // staticOption: {\n  //   root: 'static'\n  // },\n  // https: {\n  //   key: '',\n  //   cert: ''\n  // },\n  // onlisten(port) {\n  //   console.log('an app listening on ' + port);\n  // }\n}\n```\n\n* **@Router[all|get|put|post|patch|del|delete](prefix, Object)**\n\nwe provide a very nice way to make your router Configurable \u0026 Combinable \u0026 Reusable, yeah, just a function mapping. see detail [koa-router-mapping](https://github.com/famanoder/koa-router-mapping);\n\nlet's define a api, eg: `/api/user/getUserInfo`.\n\nwe recommand every api is a function or an array of function. consider the following pseudocode example.\n\n```js\nasync function getUserInfo($service, $helper) {\n  const userInfo = await $service.getUserInfo(userId);\n  $helper.success(userInfo);\n}\n\n// api path can be splited by '/'\n@Router.get('api', {\n  'user/getUserInfo': getUserInfo\n})\nclass App extends Eryue {}\n\nnew App();\n```\n\nas you see, `getUserInfo` just a function and has injected two params `$service` and `$helper`, there is too many params can be injected to our **Router** function, eg: `$context`/`$next`/`$service`/`$helper` and so on, actually, this is very pure for our api definition. as you like, you can look it as controler! \n\n* **@Middlewares**\n\n* **@Service**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffamanoder%2Feryue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffamanoder%2Feryue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffamanoder%2Feryue/lists"}