{"id":16351574,"url":"https://github.com/tomeraberbach/contextus","last_synced_at":"2025-03-23T01:30:50.197Z","repository":{"id":44593458,"uuid":"404148479","full_name":"TomerAberbach/contextus","owner":"TomerAberbach","description":"🏛️ The context you know and love, but framework agnostic!","archived":false,"fork":false,"pushed_at":"2024-10-15T03:34:01.000Z","size":300,"stargazers_count":13,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T16:13:28.193Z","etag":null,"topics":["context","context-api","dependency-injection","prop-drilling","provider","react-context","react-context-api","state-management"],"latest_commit_sha":null,"homepage":"https://npm.im/contextus","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TomerAberbach.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","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":"2021-09-07T23:19:32.000Z","updated_at":"2025-02-20T10:09:41.000Z","dependencies_parsed_at":"2024-10-28T15:20:46.063Z","dependency_job_id":"bba7e3e3-631c-48f0-b681-af064b468f74","html_url":"https://github.com/TomerAberbach/contextus","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"79bb7f5136599f4d9a7a44a5c79b5d4955ed63bf"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fcontextus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fcontextus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fcontextus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomerAberbach%2Fcontextus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomerAberbach","download_url":"https://codeload.github.com/TomerAberbach/contextus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245043842,"owners_count":20551840,"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":["context","context-api","dependency-injection","prop-drilling","provider","react-context","react-context-api","state-management"],"created_at":"2024-10-11T01:23:14.655Z","updated_at":"2025-03-23T01:30:49.905Z","avatar_url":"https://github.com/TomerAberbach.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  contextus\n\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/contextus\"\u003e\n    \u003cimg src=\"https://badgen.now.sh/npm/v/contextus\" alt=\"version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/TomerAberbach/contextus/actions\"\u003e\n    \u003cimg src=\"https://github.com/TomerAberbach/contextus/workflows/CI/badge.svg\" alt=\"CI\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=contextus\"\u003e\n    \u003cimg src=\"https://badgen.net/bundlephobia/minzip/contextus\" alt=\"minzip size\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  The context you know and love, but framework agnostic!\n\u003c/div\u003e\n\n## Features\n\n- **Microscopic:** ~300 B minzipped!\n- **Simple:** just `provide` and `use`\n- **Powerful:** supports context nesting\n- **Fancy:** contextus is Latin for context!\n\n## Install\n\n```sh\n$ npm i contextus\n```\n\n## Usage\n\n```js\nimport context from 'contextus'\n\nconst myContext = context()\n\nfunction a() {\n  b()\n\n  return `Amazing!`\n}\n\nfunction b() {\n  c()\n}\n\nfunction c() {\n  d()\n}\n\nfunction d() {\n  const value = myContext.use()\n\n  console.log(`d: ${value}`)\n  myContext.provide(`More specific wins!`, e)\n  console.log(`d: ${value}`)\n}\n\nfunction e() {\n  console.log(`e: ${myContext.use()}`)\n}\n\nconst returnValue = myContext.provide(`Spectacular!`, a)\n//=\u003e d: Spectacular!\n//=\u003e e: More specific wins!\n//=\u003e d: Spectacular!\n\nconsole.log(returnValue)\n//=\u003e Amazing!\n\ntry {\n  myContext.use()\n} catch (e) {\n  console.log(e.message)\n}\n//=\u003e context: use called outside provide\n```\n\nSee the\n[type definitions](https://github.com/TomerAberbach/contextus/blob/main/src/index.d.ts)\nfor more documentation.\n\n## Contributing\n\nStars are always welcome!\n\nFor bugs and feature requests,\n[please create an issue](https://github.com/TomerAberbach/contextus/issues/new).\n\nFor pull requests, please read the\n[contributing guidelines](https://github.com/TomerAberbach/contextus/blob/master/contributing.md).\n\n## License\n\n[Apache 2.0](https://github.com/TomerAberbach/contextus/blob/master/license)\n\nThis is not an official Google product.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomeraberbach%2Fcontextus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomeraberbach%2Fcontextus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomeraberbach%2Fcontextus/lists"}