{"id":24455559,"url":"https://github.com/nixjs/error-message","last_synced_at":"2026-05-06T10:37:56.311Z","repository":{"id":62810038,"uuid":"561595963","full_name":"nixjs/error-message","owner":"nixjs","description":"A simple component to control the error message.","archived":false,"fork":false,"pushed_at":"2022-11-04T04:42:03.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T10:27:20.871Z","etag":null,"topics":["error","error-handling","error-message","error-messages","errors","javascript","typescript","web"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nixjs.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":"2022-11-04T03:11:17.000Z","updated_at":"2022-11-04T04:22:52.000Z","dependencies_parsed_at":"2022-11-07T03:30:33.536Z","dependency_job_id":null,"html_url":"https://github.com/nixjs/error-message","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nixjs/error-message","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixjs%2Ferror-message","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixjs%2Ferror-message/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixjs%2Ferror-message/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixjs%2Ferror-message/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nixjs","download_url":"https://codeload.github.com/nixjs/error-message/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixjs%2Ferror-message/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32689469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["error","error-handling","error-message","error-messages","errors","javascript","typescript","web"],"created_at":"2025-01-21T02:13:44.139Z","updated_at":"2026-05-06T10:37:56.280Z","avatar_url":"https://github.com/nixjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @nixjs23n6/error-message\n\nA simple component to control the error message.\n\n## Quick Setup\n\n### Install\n\nInstall these dependencies:\n\n`yarn add @nixjs23n6/error-message`\n\n### Setup \u0026 Usage\n\n```typescript\nimport { BaseErrorConsts, BaseErrorTypes } from '@nixjs23n6/error-message'\n\nexport const AuthCode = 20\n\nconst enumify = BaseErrorConsts.enumifyError(['WRONG_OTP', 'TOKEN_INVALID_OR_NOT_FOUND'], 0, AuthCode)\n\nexport const ourErrors = BaseErrorConsts.enumify({ ...enumify })\n\nexport type ErrorType = keyof typeof ourErrors\n\nexport const AuthErrors: Record\u003cstring, BaseErrorTypes.Error\u003cErrorType\u003e\u003e = {\n    [ourErrors.WRONG_OTP]: {\n        type: 'WRONG_OTP',\n        code: Number(ourErrors.WRONG_OTP),\n        stringify: (otp: string) =\u003e `Wrong OTP ${otp}`,\n        format: (otp: string) =\u003e ({\n            code: AuthErrors[ourErrors.WRONG_OTP as ErrorType].code,\n            message: AuthErrors[ourErrors.WRONG_OTP as ErrorType].stringify(otp),\n        }),\n    },\n    [ourErrors.TOKEN_INVALID_OR_NOT_FOUND]: {\n        type: 'TOKEN_INVALID_OR_NOT_FOUND',\n        code: Number(ourErrors.TOKEN_INVALID_OR_NOT_FOUND),\n        stringify: (params: { accessToken: string; refreshToken: string }) =\u003e\n            `Token invalid or not found ${JSON.stringify(params.accessToken)}`,\n        format: (params: { accessToken: string; refreshToken: string }) =\u003e ({\n            code: AuthErrors[ourErrors.TOKEN_INVALID_OR_NOT_FOUND as ErrorType].code,\n            message: AuthErrors[ourErrors.TOKEN_INVALID_OR_NOT_FOUND as ErrorType].stringify(params),\n        }),\n    },\n}\n\nconsole.log(AuthErrors[ourErrors.WRONG_OTP].format())\nconsole.log(AuthErrors[ourErrors.TOKEN_INVALID_OR_NOT_FOUND].format())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixjs%2Ferror-message","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnixjs%2Ferror-message","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixjs%2Ferror-message/lists"}