{"id":18886807,"url":"https://github.com/albertfdp/dni-js","last_synced_at":"2025-07-31T11:14:43.011Z","repository":{"id":22811973,"uuid":"97374730","full_name":"albertfdp/dni-js","owner":"albertfdp","description":"Compute and validate a Spanish DNI/NIE number","archived":false,"fork":false,"pushed_at":"2023-03-04T03:51:33.000Z","size":1314,"stargazers_count":6,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T09:02:43.051Z","etag":null,"topics":["calculo","compute","dni","nie","number","numero","spain","spanish","validar","validate"],"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/albertfdp.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,"governance":null}},"created_at":"2017-07-16T10:00:55.000Z","updated_at":"2025-06-09T13:46:54.000Z","dependencies_parsed_at":"2023-09-28T03:58:13.637Z","dependency_job_id":null,"html_url":"https://github.com/albertfdp/dni-js","commit_stats":{"total_commits":34,"total_committers":3,"mean_commits":"11.333333333333334","dds":"0.38235294117647056","last_synced_commit":"df54113c09cf2195ea29803d648356d91b73297e"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/albertfdp/dni-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertfdp%2Fdni-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertfdp%2Fdni-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertfdp%2Fdni-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertfdp%2Fdni-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albertfdp","download_url":"https://codeload.github.com/albertfdp/dni-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertfdp%2Fdni-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268028543,"owners_count":24183862,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"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":["calculo","compute","dni","nie","number","numero","spain","spanish","validar","validate"],"created_at":"2024-11-08T07:30:57.658Z","updated_at":"2025-07-31T11:14:42.989Z","avatar_url":"https://github.com/albertfdp.png","language":"JavaScript","funding_links":[],"categories":["Validación de Documentos"],"sub_categories":["Metro y Cercanías"],"readme":"# dni-js\n\nCompute and validate a Spanish DNI/NIE numbers as described [here](http://www.interior.gob.es/web/servicios-al-ciudadano/dni/calculo-del-digito-de-control-del-nif-nie).\n\n[![Build Status](https://travis-ci.org/albertfdp/dni-js.svg?branch=master)](https://travis-ci.org/albertfdp/dni-js)\n[![npm version](https://badge.fury.io/js/dni-js.svg)](https://badge.fury.io/js/dni-js)\n\n## Install\n\n```\n$ npm install dni-js\n```\n\n## Usage\n\nValidation is based on this [document](http://www.interior.gob.es/web/servicios-al-ciudadano/dni/calculo-del-digito-de-control-del-nif-nie).\n\n```js\nconst dni = require('dni-js');\n\ndni.isValid('12345678-Z'); // =\u003e true\n```\n\n### API\n\n#### `.dni (number|string)`\n\nReturns a DNI number with the control digit appended in the format `12345678-Z`. If the input is invalid,\nreturns `null`.\n\n#### `.nie (number|string)`\n\nReturns a NIE number with the control digit appended in the format `X1234567-L`. If the input is invalid,\nreturns `null`.\n\n#### `.getControlDigit (number|string)`\n\nReturns the control digit for the input.\n\n#### `.getLetter (number|string)`\n\nAlias for `getControlDigit`.\n\n#### `.isValid (string)`\n\nReturns `true` or `false` by validating the input.\n\n#### `.normalize (string)`\n\nGiven a string input, it returns a normalized valid DNI. When input is either not a string, or invalid, it returns null. For example:\n\n```js\ndni.normalize('   12 34 56 7 8-z'); // 12345678-Z\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertfdp%2Fdni-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbertfdp%2Fdni-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertfdp%2Fdni-js/lists"}