{"id":13452227,"url":"https://github.com/rthor/isjs","last_synced_at":"2026-01-10T08:41:32.841Z","repository":{"id":7490201,"uuid":"8839177","full_name":"rthor/isjs","owner":"rthor","description":"Check your data against regular expressions or known keywords.","archived":false,"fork":false,"pushed_at":"2015-02-22T21:33:29.000Z","size":517,"stargazers_count":272,"open_issues_count":3,"forks_count":15,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-07T05:19:51.839Z","etag":null,"topics":[],"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/rthor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-17T18:35:44.000Z","updated_at":"2025-01-02T01:12:37.000Z","dependencies_parsed_at":"2022-09-01T22:21:49.437Z","dependency_job_id":null,"html_url":"https://github.com/rthor/isjs","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rthor%2Fisjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rthor%2Fisjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rthor%2Fisjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rthor%2Fisjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rthor","download_url":"https://codeload.github.com/rthor/isjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245159188,"owners_count":20570341,"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-07-31T07:01:17.561Z","updated_at":"2026-01-10T08:41:32.790Z","avatar_url":"https://github.com/rthor.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# is.js\n\nCheck your data against regular expressions or known keywords (see Keyword section). Different versions for different platforms are availible.\n\nCurrently these *plugins* are stable:\n\n- jQuery\n- Vanilla JavaScript\n- Node.js Module\n\nI wrote a really short blog post about the project a while ago, which can be read at [rthor.is/javascript/cross-plugin-javascript-project-isjs](http://rthor.is/javascript/cross-plugin-javascript-project-isjs/). *Note that some code examples are out of date*.\n\n## Keywords\n\n**cc (Credit cards)**\n\nWorks for:\n\nAmerican Express\n\nDiscover\n\nMasterCard\n\nVisa\n\n*or any*\n\n```javascript\n// Example (vanilla JS)\nis('0000000000000000', 'cc:any'); // Returns true\nis('4000000000000000', 'cc:Visa'); // Returns true\n```\n\n**datetime (Date and time)**\n\nFormat: 1996-12-19T16:39:57-08:00\n\n```javascript\n// Example (vanilla JS)\nis('1996-12-19T16:39:57-08:00', 'datetime'); // Returns true\n```\n\n**isbn (ISBN)**\n\nISBN 10\n\n```javascript\n// Example (vanilla JS)\nis('0-85131-041-9', 'isbn'); // Returns true\nis('0851310419', 'isbn'); // Returns true\n```\n\nISBN 13\n\n```javascript\n// Example (vanilla JS)\nis('978-1-56619-909-4', 'isbn'); // Returns true\nis('9781566199094', 'isbn'); // Returns true\n```\n\n**latlng (Latitude and longitude)**\n\nLatitude\n\n```javascript\n// Example (vanilla JS)\nis('64.163296', 'latlng'); // Returns true\n```\n\nLongitude\n\n```javascript\n// Example (vanilla JS)\nis('-21.859328', 'latlng'); // Returns true\n```\n\n**phone (Phone numbers)**\n\nArgentina (ar)\n\nAustralia (au)\n\nFrance (fr)\n\nIceland (is)\n\nUnited Kingdom (uk)\n\nUnited States of America (us)\n\n```javascript\n// Example (vanilla JS)\nis('+354 000-0000', 'phone:is'); // Returns true\nis('000-0000', 'phone:is'); // Returns true\nis('0000000', 'phone:is'); // Returns true\n```\n\n**zip:'two letter ISO 3166 country code' (Zip codes for countries)**\n\nArgentina (ar)\n\nAustralia (au)\n\nAustria (at)\n\nBelgium (be)\n\nBrazil (br)\n\nBulgaria (bg)\n\nCanada (ca)\n\nCroatia (hr)\n\nCyprus (cy)\n\nCzech Republic (cz)\n\nDenmark (dk)\n\nEstonia (ee)\n\nFinland (fi)\n\nFrance (fr)\n\nGermany (de)\n\nGreat Britain (gb)\n\nGreece (gr)\n\nHungary (hu)\n\nIceland (is)\n\nItaly (it)\n\nJapan (jp)\n\nLatvia (lv)\n\nLithuania (lt)\n\nLuxembourg (lu)\n\nMalta (mt)\n\nNetherlands (nl)\n\nNorway (no)\n\nPoland (pl)\n\nPortugal (pt)\n\nRomania (ro)\n\nSlovakia (sk)\n\nSlovenia (se)\n\nSpain (es)\n\nSweden (se)\n\nTurkey (tr)\n\nUkraine (ua)\n\nUnited States of America (us)\n\n\n```javascript\n// Example (vanilla JS)\nis('112', 'zip:is'); // Returns true\nis('32044', 'zip:us'); // Returns true\n```\n\n## Additional Goodies\n\nThe second parameter can point to a function within the `check.fn` object. It can also be a regular user defined function accepting a single argument which can be used for some complex (or simple) validation.\n\n```javascript\n// Example (vanilla JS)\nis(42, function ( num ) {\n\treturn num === 20; // returns false\n});\n```\n\nThe expression argument can be an actual regular expression.\n\n```javascript\n// Example (vanilla JS)\nis('love', /.+/); // returns true\n```\n\n## Change Log\n\n### 0.2.1 *AUGUST 3, 2013*\n\n- Add a Luhn algorithm as a check function. Thanks everyone who pointed out the need for it.\n\n- Fix the README.\n\n- Rename the `regex` obj to `check`. It just makes more sense since we now have function tests.\n\n### 0.2.0 *JULY 30, 2013*\n\n- All regular expressions are unit tested.\n\n- Added functionality to validate via functions. The second argument can now either be a regular function accepting a single argument or a string pointing to a function within the `regex.fn` object.\n\n- Current functions include: even, odd, regexp, ok and function.\n\n### 0.1.2 *JUNE 14, 2013*\n\n- `phone` has become an object so calling it requires a two letter ISO 3166 country code. For example validating Icelandic phone numbers in vanilla JS is now done thusly: `is('+354 000-0000', 'phone:is')`. In addition a few more countries were added.\n\n- `cc` - pretty much same thing happend as with the `phone` thing.\n\n### 0.1.1 *May 24, 2013*\n\n- First stable release\n\n## Get in touch\n\nFollow me on twitter [@rthor](http://twitter.com/rthor) or send me a line in an [email](mailto:ragnar.valgeirsson@gmail.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frthor%2Fisjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frthor%2Fisjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frthor%2Fisjs/lists"}