{"_id":"@doncicuto/es-municipalities","_rev":"1-6deb13fced897e11a03671edd670834a","name":"@doncicuto/es-municipalities","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@doncicuto/es-municipalities","version":"1.0.0","description":"NPM package containing the name and INE code of Spain's municipalities","main":"lib/index.js","types":"lib/index.d.ts","repository":{"type":"git","url":"git+https://github.com/doncicuto/es-municipalities.git"},"bugs":{"url":"https://github.com/doncicuto/es-municipalities/issues"},"homepage":"https://github.com/doncicuto/es-municipalities#readme","keywords":["España","Spain","provincias","provinces","municipios","municipalities","territorios","territories","INE"],"author":{"name":"Miguel Cabrerizo"},"license":"MIT","scripts":{"build":"tsc","test":"jest","lint":"eslint . --ext .js,.ts","prepare":"npm run build","prepublishOnly":"npm test && npm run lint","preversion":"npm run lint","version":"git add -A src","postversion":"git push && git push --tags"},"devDependencies":{"@types/jest":"^26.0.20","@typescript-eslint/eslint-plugin":"^4.16.1","@typescript-eslint/parser":"^4.16.1","eslint":"^7.21.0","jest":"^26.6.3","prettier":"^2.2.1","ts-jest":"^26.5.3","typescript":"^4.2.3"},"gitHead":"9de2dae5bad044f5aea78f937e1abe429470205e","_id":"@doncicuto/es-municipalities@1.0.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-h3RUQ27Bv5B2ZKwOSYPvvzNok4UemL2y2YxyTiHYzL/zObqKb1TC4komwBbHzbjcv1lYT/r94Swaw/RgTNj9ig==","shasum":"1cb58649340697872cf286ab50380181c3b3dfa0","tarball":"https://registry.npmjs.org/@doncicuto/es-municipalities/-/es-municipalities-1.0.0.tgz","fileCount":7,"unpackedSize":1491639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgThIYCRA9TVsSAnZWagAA6CcP/jUpf1+uoqdZi7J3yCS2\nDrQM5BkgBNTbTSDdWGoRa8PDX+U2xlAmiXDtt6x9sXKW3CP5U4oecwJ+qNQU\n41Sij+yTqEVZbRKJx+AsLNsO4vlRrl+yw5/YPP7kEjbkp+PAi6vzyt0Sz/J4\nnruAk81xTrJKaTOydp4nIYwZH4mBIE/i/+NPCRWXtk3EK27jcbMFNl6IRzPC\nm+MO5Pnbg6x0aAmKMMX9Cb/2ny6w8erHwUnhqksCCbR5AXM6NcXfMIEu31IN\n6jd76L0Cw4MYAEGyb5Jr2evmqUZLVMx+IigtkdJS3zoPpHtY9SwjNG3+QmH/\nPJG1EyI4mKiSarvcH/x5+4Tl8lCFheTRIuN4l9tzs9o0I0/W1dMo2wQg4a+C\ndTlcC0wvB64ORuimq4H8dGSAou37F7fV4xuwOZX9YD4mlijP8WzHzZgq+sTa\nryrlNn9uMOtgiVoyWkt3ihP2zB/9v8gL2p7jmI9y915OhuT2jHrZ7/rvIp6A\n6v5G/hiHN41W6nxNWevy/oapQuFzwzx9AR9/r+E0DM5+Qp85Dhw6UMui95fj\nFavlO3ROYRTz2adYry/2QxOzD7chVKS+PdXiNKf9GrNMQ4unwNfLJ3iRU+ls\nrOnOB85Yj8enDoFESnBoSmSPpOulf8fhyU4wdVlAR1PtsMgNM+yRz9Qmk3Oy\nJIgt\r\n=RpgP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXF6nP93tk6rXE3gK9GhizAkWwUcQbQ+Vkh6oUaY51pQIhANbj6tC1Yy+Hk9cYJjWy33J6sGyVQiomt+y+8zD4GyFA"}]},"_npmUser":{"name":"mcabrerizo","email":"mcabrerizo@arrakis.ovh"},"directories":{},"maintainers":[{"name":"mcabrerizo","email":"mcabrerizo@arrakis.ovh"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/es-municipalities_1.0.0_1615729176057_0.468079735456453"},"_hasShrinkwrap":false}},"time":{"created":"2021-03-14T13:39:35.836Z","1.0.0":"2021-03-14T13:39:36.243Z","modified":"2022-04-05T05:15:09.252Z"},"maintainers":[{"name":"mcabrerizo","email":"mcabrerizo@arrakis.ovh"}],"description":"NPM package containing the name and INE code of Spain's municipalities","homepage":"https://github.com/doncicuto/es-municipalities#readme","keywords":["España","Spain","provincias","provinces","municipios","municipalities","territorios","territories","INE"],"repository":{"type":"git","url":"git+https://github.com/doncicuto/es-municipalities.git"},"author":{"name":"Miguel Cabrerizo"},"bugs":{"url":"https://github.com/doncicuto/es-municipalities/issues"},"license":"MIT","readme":"# ES-Municipalities\n\nThis package offers Spain's municipalities names and codes as shown in INE (Spain's National Statistics Institute).\n\nAccording to Wikipedia:\n>A municipality is usually a single administrative division having corporate status and powers of self-government or jurisdiction as granted by national and regional laws to which it is subordinate.\n\nAlso Wikipedia has an specific page for [municipalities of Spain](https://en.wikipedia.org/wiki/Municipalities_of_Spain).\n\nXLSX Files provided by INE are updated the first day of every year and can be found at [https://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736177031&menu=ultiDatos&idp=1254734710990](https://www.ine.es/dyngs/INEbase/es/operacion.htm?c=Estadistica_C&cid=1254736177031&menu=ultiDatos&idp=1254734710990).\n\nEvery change after the first day of the year is logged in the same page and this package will update its data accordingly. Information about new changes will be shown in this README file.\n\nThis package contains the data extracted from the information contained in an [XLSX file provided by INE](https://www.ine.es/daco/daco42/codmun/diccionario21.xlsx).\n\nThis package offers two files:\n\n- An index.js file that contains an array with municipalities,\n- A JSON file that you can read and parse to be offered using a REST API or to insert records into a database.\n\n## Install\n\n```bash\nyarn add @doncicuto/es-municipalities\n```\n\nor\n\n```bash\nnpm install @doncicuto/es-municipalities --save\n```\n\n## Usage\n\nThe default export is an array of objects with the following structure:\n\n| Property   | Type     | Description                     | Example           |\n| ---------- | -------- | ------------------------------- | ----------------- |\n| `commCode` | `string` | INE's Autonomous community code | `07`              |\n| `provCode` | `string` | INE's province code             | `47`              |\n| `code`     | `string` | INE's municipality code         | `186`             |\n| `dc`       | `string` | Control digit                   | `8`               |\n| `name`     | `string` | province name                   | `Valladolid`      |\n\nYou can use [@doncicuto/es-provinces](https://www.npmjs.com/package/@doncicuto/es-provinces) and/or [@doncicuto/es-autonomous-communities](https://www.npmjs.com/package/@doncicuto/es-autonomous-communities) if you want to use the province and autonomous community codes to get the province and community names.\n\n> **_WARNING_** Be warned that this array contains 8131 municipalities so it may be heavy for your usage case. You may prefer to use the JSON file called **'municipalitiesWithProvinces.json'** contained in the lib folder.\n\nExample (Browser):\n\n```ts\nimport municipalities from \"@doncicuto/es-municipalities\";\n\nconst names = municipalities.map((p) => p.name);\nconsole.log(names);\n\nconst filtered = municipalities.filter((p) => p.commCode === \"07\");\nconsole.log(filtered);\n```\n\nExample (NodeJS):\n\n```js\nconst municipalities = require(\"@doncicuto/es-municipalities\").default;\n\nconst names = municipalities.map((p) => p.name);\nconsole.log(names);\n\nconst filtered = municipalities.filter((p) => p.commCode === \"07\");\nconsole.log(filtered);\n```\n","readmeFilename":"README.md"}