{"id":13670530,"url":"https://github.com/zertosh/invariant","last_synced_at":"2025-05-14T03:08:17.982Z","repository":{"id":21100758,"uuid":"24401110","full_name":"zertosh/invariant","owner":"zertosh","description":"invariant","archived":false,"fork":false,"pushed_at":"2021-12-14T00:53:36.000Z","size":28,"stargazers_count":1229,"open_issues_count":16,"forks_count":70,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-05T19:13:08.768Z","etag":null,"topics":[],"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/zertosh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-24T04:47:25.000Z","updated_at":"2025-04-27T22:04:19.000Z","dependencies_parsed_at":"2022-08-08T12:30:18.482Z","dependency_job_id":null,"html_url":"https://github.com/zertosh/invariant","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zertosh%2Finvariant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zertosh%2Finvariant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zertosh%2Finvariant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zertosh%2Finvariant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zertosh","download_url":"https://codeload.github.com/zertosh/invariant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253528365,"owners_count":21922623,"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-08-02T09:00:44.468Z","updated_at":"2025-05-14T03:08:17.783Z","avatar_url":"https://github.com/zertosh.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# invariant\n\n[![Build Status](https://travis-ci.org/zertosh/invariant.svg?branch=master)](https://travis-ci.org/zertosh/invariant)\n\nA mirror of Facebook's `invariant` (e.g. [React](https://github.com/facebook/react/blob/v0.13.3/src/vendor/core/invariant.js), [flux](https://github.com/facebook/flux/blob/2.0.2/src/invariant.js)).\n\nA way to provide descriptive errors in development but generic errors in production.\n\n## Install\n\nWith [npm](http://npmjs.org) do:\n\n```sh\nnpm install invariant\n```\n\n## `invariant(condition, message)`\n\n```js\nvar invariant = require('invariant');\n\ninvariant(someTruthyVal, 'This will not throw');\n// No errors\n\ninvariant(someFalseyVal, 'This will throw an error with this message');\n// Error: Invariant Violation: This will throw an error with this message\n```\n\n**Note:** When `process.env.NODE_ENV` is not `production`, the message is required. If omitted, `invariant` will throw regardless of the truthiness of the condition. When `process.env.NODE_ENV` is `production`, the message is optional – so they can be minified away.\n\n### Browser\n\nWhen used with [browserify](https://github.com/substack/node-browserify), it'll use `browser.js` (instead of `invariant.js`) and the [envify](https://github.com/hughsk/envify) transform will inline the value of `process.env.NODE_ENV`.\n\n### Node\n\nThe node version is optimized around the performance implications of accessing `process.env`. The value of `process.env.NODE_ENV` is cached, and repeatedly used instead of reading `process.env`. See [Server rendering is slower with npm react #812](https://github.com/facebook/react/issues/812)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzertosh%2Finvariant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzertosh%2Finvariant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzertosh%2Finvariant/lists"}