{"id":16760363,"url":"https://github.com/ryanve/cmon","last_synced_at":"2025-03-16T09:16:41.860Z","repository":{"id":8364597,"uuid":"9930655","full_name":"ryanve/cmon","owner":"ryanve","description":"CommonJS and ender-inspired require/provide with events","archived":false,"fork":false,"pushed_at":"2013-11-09T06:49:37.000Z","size":322,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T21:51:21.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cmon","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/ryanve.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":"2013-05-08T07:17:24.000Z","updated_at":"2016-12-08T06:32:20.000Z","dependencies_parsed_at":"2022-08-07T04:01:03.977Z","dependency_job_id":null,"html_url":"https://github.com/ryanve/cmon","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Fcmon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Fcmon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Fcmon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Fcmon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanve","download_url":"https://codeload.github.com/ryanve/cmon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847056,"owners_count":20357317,"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-13T04:23:16.135Z","updated_at":"2025-03-16T09:16:41.836Z","avatar_url":"https://github.com/ryanve.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [cmon](../../)\n\n#### [CommonJS](http://en.wikipedia.org/wiki/CommonJS) and [ender](https://github.com/ender-js/ender-js)-inspired require/provide with events\n\n```sh\n$ npm install cmon\n```\n\n## API ([0.6](../../releases))\n\n### cmon()\n\n- `cmon(id)` Delegate to `cmon.require(id)`.\n- `cmon(id, value)` Delegate to `cmon.provide(id, value)`.\n- `cmon(id, value, guard)` Delegate to `cmon.require(id)`.\n- `cmon(fn)` Call `fn` in the root scope and receive `(cmon)`.\n\n### .require / .provide\n\nAt runtime in a browser `cmon` claims the global `require`/`provide` **if** unclaimed. Otherwise access them as methods:\n\n- `cmon.require(id)` Get a module that was provided via `cmon.provide`.\n- `cmon.require(deps, fn)` Async (\u003cvar\u003efn\u003c/var\u003e applies with \u003cvar\u003edeps\u003c/var\u003e when available).\n- `cmon.provide(id, value)` Provide a module.\n- `cmon.provide.on(id, fn)` Attach a handler to run anytime \u003cvar\u003eid\u003c/var\u003e is provided.\n- `cmon.provide.one(id, fn)` Attach a 1-time handler to run the next time \u003cvar\u003eid\u003c/var\u003e is provided.\n- `cmon.provide.off(id, fn)` Remove a handler.\n- `cmon.provide.off(id)` Remove all \u003cvar\u003eid\u003c/var\u003e handlers.\n- `cmon.provide.emit(id)` Manually trigger active `id` handlers.\n- `cmon.able(id, fn?, timeout?)` Attach a 1-time handler runs when `id` is available\u0026mdash;async.\n\n### .claim / .unclaim\n\n- `cmon.claim(id, value, target?)` Expose a module to the \u003cb\u003eroot\u003c/b\u003e or to \u003cvar\u003etarget\u003c/var\u003e.\n- `cmon.unclaim(id, value, target?)` Safely unexpose a module that was exposed via claim.\n\n### .noConflict\n\n- `cmon.noConflict()` Unclaim `require`/`provide`\n- `cmon.noConflict(true)` Unclaim `require`/`provide`/`cmon`\n- `cmon.noConflict(callback)` Unclaim `require`/`provide`/`cmon`\n\n## Developers\n\n\u003cb\u003eContribute\u003c/b\u003e by making edits in [`/src`](./src) or reporting [issues](../../issues).\n\n```sh\n$ npm install\n$ grunt jshint:src\n```\n\n## Fund\n\nFund development with [tips to @ryanve](https://www.gittip.com/ryanve/) =)\n\n## License: [MIT](http://opensource.org/licenses/MIT)\n\nCopyright (C) 2013 by [Ryan Van Etten](https://github.com/ryanve)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanve%2Fcmon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanve%2Fcmon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanve%2Fcmon/lists"}