{"id":13719601,"url":"https://github.com/vzhufk/z1p","last_synced_at":"2026-01-12T05:47:13.586Z","repository":{"id":57143185,"uuid":"154473057","full_name":"vzhufk/z1p","owner":"vzhufk","description":"Zip Codes Validation and Parse.","archived":false,"fork":false,"pushed_at":"2018-11-01T11:52:24.000Z","size":96336,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-07T11:16:35.000Z","etag":null,"topics":["data","geo","geocode","geolocation","latitude","longitude","zip","zipcode"],"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/vzhufk.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-10-24T09:18:46.000Z","updated_at":"2023-09-04T04:02:42.000Z","dependencies_parsed_at":"2022-09-05T22:30:16.896Z","dependency_job_id":null,"html_url":"https://github.com/vzhufk/z1p","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vzhufk/z1p","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzhufk%2Fz1p","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzhufk%2Fz1p/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzhufk%2Fz1p/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzhufk%2Fz1p/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vzhufk","download_url":"https://codeload.github.com/vzhufk/z1p/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzhufk%2Fz1p/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["data","geo","geocode","geolocation","latitude","longitude","zip","zipcode"],"created_at":"2024-08-03T01:00:52.570Z","updated_at":"2026-01-12T05:47:13.566Z","avatar_url":"https://github.com/vzhufk.png","language":"JavaScript","funding_links":[],"categories":["Misc"],"sub_categories":[],"readme":"## Zip Codes Validation and Parse :mailbox_with_mail:\n\n[![Build Status](https://travis-ci.com/vzhufk/z1p.svg?branch=master)](https://travis-ci.com/vzhufk/z1p)\n\nThe module that can be used for search places via zip code and other geolocation properties.\n\n## Usage\n\nInstall package:\n\n```shell\nnpm i z1p\n```\n\nThen you need to add countries you wish to search in. For example the USA.\n\n```shell\nnpm i @zip/us\n```\n\nThen you can use it like this:\n\n```js\nconst z1p = require(\"z1p\");\n\n// Get places by zip code.\nz1p([\"US\"]).raw(v =\u003e v.zip_code == \"59330\");\n\n// Same as above\nz1p([\"us\"]).findBy(\"zip_code\", \"59330\"));\n\n// Same as above but memorized\nz1p([\"Us\"], {memorize: true}).findBy(\"zip_code\", \"59330\"));\n\n//Result\n/*\n[ { accuracy: '1',\n    community: null,\n    community_code: null,\n    country_code: 'US',\n    latitude: '47.1008',\n    longitude: '-104.7287',\n    place: 'Glendive',\n    province: 'Dawson',\n    province_code: '021',\n    state: 'Montana',\n    state_code: 'MT',\n    zip_code: '59330' } ]\n*/\n```\n\n## API\n\n### z1p(codes, options)\n\n- `codes` `{Array of Strings}` Country codes to search in. By default equals all available.\n- `options` `{Object}`\n  - `memorize` `{Boolean}` `default: false` this options for memorization at methods\n\n### .raw(compare)\n\n- `compare` `{Function}` function to find.  \n  **returns**: {Array of Places}\n\n### .findBy(key, value)\n\n- `key` `{String}` key in object strucuture (zip_code, accuracy, etc.)\n- `value` `{String}` value to find.\n\n  **returns**: {Array of Places}\n\n_Note:_ This method could be memorized. Every result will be saved to memory so the only first call will be slow.\n\nPlace object looks like this:\n\n```js\n{\n  accuracy: '1', // Accuracy of place\n  community: 'community', // Community name\n  community_code: 'community_code', // Community code\n  country_code: 'country_code', // Country code\n  latitude: '1', // Latitude\n  longitude: '-1', // Longitude\n  place: 'place', // Place\n  province: 'province', // Province\n  province_code: '021', // Province code\n  state: 'state', // State\n  state_code: 'state_code', // State code\n  zip_code: '1' // Zip code\n}\n```\n\n**Example:**\n\n```js\n  { accuracy: '1',\n    community: null,\n    community_code: null,\n    country_code: 'US',\n    latitude: '47.1008',\n    longitude: '-104.7287',\n    place: 'Glendive',\n    province: 'Dawson',\n    province_code: '021',\n    state: 'Montana',\n    state_code: 'MT',\n    zip_code: '59330' }\n```\n\n## Countries\n\n### [Available countries](https://github.com/vzhufk/z1p/tree/master/assets).\n\n## TODO:\n\n1. Add wrappers to raw.\n2. Improve performance.\n\n### GeoData provided by **[geonames.org](http://www.geonames.org/)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvzhufk%2Fz1p","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvzhufk%2Fz1p","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvzhufk%2Fz1p/lists"}