{"id":16384938,"url":"https://github.com/saber2pr/mod","last_synced_at":"2025-06-17T20:44:21.457Z","repository":{"id":108571348,"uuid":"228411940","full_name":"Saber2pr/mod","owner":"Saber2pr","description":"a module style for js.","archived":false,"fork":false,"pushed_at":"2019-12-19T05:05:07.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-02T14:44:43.475Z","etag":null,"topics":["module-system"],"latest_commit_sha":null,"homepage":null,"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/Saber2pr.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,"publiccode":null,"codemeta":null}},"created_at":"2019-12-16T15:01:27.000Z","updated_at":"2019-12-19T05:05:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"70a67b5c-f60f-4734-a30a-1fb35c60e520","html_url":"https://github.com/Saber2pr/mod","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/Saber2pr%2Fmod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fmod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fmod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saber2pr%2Fmod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saber2pr","download_url":"https://codeload.github.com/Saber2pr/mod/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240122162,"owners_count":19751134,"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":["module-system"],"created_at":"2024-10-11T04:13:00.920Z","updated_at":"2025-02-22T03:26:36.418Z","avatar_url":"https://github.com/Saber2pr.png","language":"JavaScript","readme":"# mod\n\na module style for js.\n\n\u003e do you know monad? :)\n\n```html\n\u003cscript src=\"https://saber2pr.top/mod/mod.min.js\"\u003e\u003c/script\u003e\n```\n\n# API\n\n```ts\nfunction mod\u003cT\u003e(creator: () =\u003e Promise\u003cT\u003e): Promise\u003cT\u003e\nfunction mod\u003cT\u003e(\n  creator: (join: (dep: string) =\u003e Promise\u003cany\u003e) =\u003e Promise\u003cT\u003e\n): Promise\u003cT\u003e\n```\n\n1. define a module:\n\n```js\n// ./add.js\nmod(() =\u003e {\n  const add = (a, b) =\u003e a + b\n  return add\n})\n```\n\n2. import a module\n\n```js\n// ./main.js\nmod(async require =\u003e {\n  // import module\n  const add = await require(\"./add.js\")\n\n  console.log(add(1, 2))\n})\n```\n\n\u003e It looks like the do-block in haskell?\n\n# License\n\nMIT\n\n\u003e Author: saber2pr\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaber2pr%2Fmod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaber2pr%2Fmod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaber2pr%2Fmod/lists"}