{"id":16433793,"url":"https://github.com/lorissigrist/rsc-env","last_synced_at":"2025-03-16T17:35:52.861Z","repository":{"id":234146335,"uuid":"788339335","full_name":"LorisSigrist/rsc-env","owner":"LorisSigrist","description":"A tiny package that uses export conditions do differentiate between server-component and non-server-component environments","archived":false,"fork":false,"pushed_at":"2024-04-22T14:48:02.000Z","size":5,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-12T08:47:11.991Z","etag":null,"topics":["app-router","app-router-nextjs","nextjs14","react-server-components","rsc"],"latest_commit_sha":null,"homepage":"","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/LorisSigrist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2024-04-18T08:17:52.000Z","updated_at":"2024-06-06T14:41:09.000Z","dependencies_parsed_at":"2024-04-22T16:09:09.698Z","dependency_job_id":null,"html_url":"https://github.com/LorisSigrist/rsc-env","commit_stats":null,"previous_names":["lorissigrist/rsc-env"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorisSigrist%2Frsc-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorisSigrist%2Frsc-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorisSigrist%2Frsc-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorisSigrist%2Frsc-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LorisSigrist","download_url":"https://codeload.github.com/LorisSigrist/rsc-env/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221666417,"owners_count":16860415,"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":["app-router","app-router-nextjs","nextjs14","react-server-components","rsc"],"created_at":"2024-10-11T08:47:14.458Z","updated_at":"2024-10-27T11:01:32.303Z","avatar_url":"https://github.com/LorisSigrist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RSC-ENV\n\nInspired by the brilliant [`esm-env`](https://github.com/benmccann/esm-env?tab=readme-ov-file)\n\nUses export conditions to return if the current environment is `react-server` or not. Bundlers can statically determine the environment at build time \u0026 remove dead code.\n\nThis is useful for writing utility functions that may be called by either server or client components.\n\n## Example\n\n```bash\nnpm install rsc-env\n```\n\n```ts\n// utils/shared.ts\nimport { rsc } from \"rsc-env\";\n\n// This code will be treeshaken from client-component builds\nif(rsc) console.log(\"I'm running in a server component\")\n```\n\n## License\n\n[MIT](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florissigrist%2Frsc-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Florissigrist%2Frsc-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florissigrist%2Frsc-env/lists"}