{"_id":"@dwp/get-state-pension-date","_rev":"4-7376959f10647834ef94728ba80fcaef","name":"@dwp/get-state-pension-date","dist-tags":{"latest":"2.0.2"},"versions":{"2.0.2":{"name":"@dwp/get-state-pension-date","version":"2.0.2","author":{"name":"DWP Digital","email":"open-source@engineering.digital.dwp.gov.uk"},"license":"ISC","_id":"@dwp/get-state-pension-date@2.0.2","maintainers":[{"name":"lhokktyn","email":"lhokk.tyn@gmail.com"}],"homepage":"https://github.com/dwp/get-state-pension-date#readme","bugs":{"url":"https://github.com/dwp/get-state-pension-date/issues"},"dist":{"shasum":"8838d42dbb0aeb65ba221742da53fb461ae31178","tarball":"https://registry.npmjs.org/@dwp/get-state-pension-date/-/get-state-pension-date-2.0.2.tgz","fileCount":9,"integrity":"sha512-cMcVYybHfqYn0+fL8DdpkhHKwDa7I/IV8jeADZeMpvgIh9D9nN+kx9f62pifQE8BKqdrEtNM3WESdTfKgYFVfg==","signatures":[{"sig":"MEUCIFfxeeplTovrmFMn3+RAisgRMYJTNjipvpPEowY2uXerAiEA6c9uo726dJYlk4+jC2BvpxAI6+ZLEFQZAyaAmExFmSw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhC6DfCRA9TVsSAnZWagAACVYP/0s00pUAsmYXYNl65uhq\nRwFHZ6S6s/d9qOfbeRkYfIBtKL8LZp4pR2SSJzDGHlP0SXidip1l7JUkeaKr\nF0BhPAyXHiY8/js9U4bq6m+TJD0f4NN0KcqzgE2jpLa/mCrGhqYUtLIaWNcK\nKOlLJ5dtNYtCfy3PO+Grpjzrm6YfuWnGcbXJmWnpMk+x07K+mtKQFDZR+OlR\nDrYfvYlpx6mFgKBnnmGu/0Mti6SQB3kQ54FhRziroJ6aeBeRhDf1tI21keMh\nlzbu9Ps4EubmnYNEk1bYlN99OP1B0oGafBLSAz1FUVZe0h8BCv5D2/dkMjGl\nsg/NBOxGR6wkydAqYehbom1MiYezyNKH65NhlvEEhNzvLRfB22/YOhmMCGbD\n2vtRy7M80rEOh8k/gp4UqeCmp9fyONErmccJprg684iRwUvSfy5WCno5RJef\ni1J3TbTGFX84pXRWMHc6mV251kssLHtA5IyYpNxpR81XJEsmVN/Bm0HnnEEZ\nKXigdXo5fc9O/dBwHDL9A226mmegjsejJXAU9bwe2YCojLvOswBvrH+33xAO\nt3de1ccprEetd19rchjjjm8v5xnsTbVn6bDpB+E0dR6X1CGuwmNLvCEvqpWn\nB5K6H7iV6BqCeIIS/h7zfrt29Jn4dI/IK82G0/nnjnM1vm7mDmBZ5Mg+nU1D\nFNv+\r\n=4fvb\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/get-state-pension-date.js","engines":{"node":">8.9.1"},"gitHead":"4e2e1409241c6d6fc2e962a8994cb4e5fcd070f8","scripts":{"lint":"eslint .","test":"tap test"},"_npmUser":{"name":"lhokktyn","email":"lhokk.tyn@gmail.com"},"repository":{"url":"git+https://github.com/dwp/get-state-pension-date.git","type":"git"},"_npmVersion":"6.14.13","description":"For a given date of birth, and gender, return the date on which the UK State Pension will be available.","directories":{},"_nodeVersion":"14.17.2","_hasShrinkwrap":false,"devDependencies":{"nyc":"15.1.0","tap":"15.0.9","eslint":"7.26.0","timekeeper":"2.2.0","eslint-plugin-sonarjs":"0.7.0","@dwp/eslint-config-base":"5.0.1"},"_npmOperationalInternal":{"tmp":"tmp/get-state-pension-date_2.0.2_1628152031597_0.664536187218385","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-08-05T08:27:11.552Z","modified":"2025-02-19T14:43:36.201Z","2.0.2":"2021-08-05T08:27:11.725Z"},"bugs":{"url":"https://github.com/dwp/get-state-pension-date/issues"},"author":{"name":"DWP Digital","email":"open-source@engineering.digital.dwp.gov.uk"},"license":"ISC","homepage":"https://github.com/dwp/get-state-pension-date#readme","repository":{"url":"git+https://github.com/dwp/get-state-pension-date.git","type":"git"},"description":"For a given date of birth, and gender, return the date on which the UK State Pension will be available.","maintainers":[{"email":"lhokk.tyn@gmail.com","name":"lhokktyn"},{"email":"open-source@engineering.digital.dwp.gov.uk","name":"dwp-bot"}],"readme":"# get-state-pension-date #\n\nThis package provides functions that allows the calculation of the date on which a UK citizen becomes eligible for their State Pension.\n\n## Installation\n\n```bash\nnpm install @dwp/get-state-pension-date\n```\n\n## Usage\n\n### `getStatePensionDate()`\nTakes a date of birth string and a gender and returns a `Date` object representing when State Pension age would be reached.\n\n**For example:**\n\n```javascript\nconst {getStatePensionDate} = require('@dwp/get-state-pension-date');\n\n// Date: 2058-03-25T00:00:00.000Z\nconst spaDate = getStatePensionDate('1990-03-25', 'male');\n```\n\n### `getStatePensionDateAsString()`\nTakes the same parameters as `getStatePensionDate()` but returns the State Pension age date as a `string`.\n\n**For example:**\n\n```javascript\nconst {getStatePensionDateAsString} = require('@dwp/get-state-pension-date');\n\n// string: 2058-03-25\nconst spaString = getStatePensionDateAsString('1990-03-25', 'female');\n```\n\n### `isOverStatePensionAge()`\nTakes a date of birth and returns a `boolean`, returning `true` if the State Pension age date is today or in the past, `false` if it’s in the future.\n\n**For example:**\n\n```javascript\nconst {isOverStatePensionAge} = require('@dwp/get-state-pension-date');\n\n// boolean: true\nconst overSpa = isOverStatePensionAge('1953-03-25');\n\n// boolean: false\nconst workingAge = isOverStatePensionAge('1990-03-25');\n```\n\nAll functions will throw if the date of birth is not a `YYYY-MM-DD` formatted string or if the gender is not a string of `male` or `female`.\n\n## Caveat\n\nThe dates produced by this package are based on legislation in place at the point of publishing (November 2018).\nDates that fall beyond the current legislation (i.e. after 5/4/1977) are calculated on a best endeavours basis only.\n\n[Further information about State Pension age timetables](https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/310231/spa-timetable.pdf).\n","readmeFilename":"README.md"}