{"id":16718745,"url":"https://github.com/planeshifter/guess-age","last_synced_at":"2025-10-25T10:43:08.985Z","repository":{"id":148376692,"uuid":"41814643","full_name":"Planeshifter/guess-age","owner":"Planeshifter","description":"Guess the age of a person only from their first name.","archived":false,"fork":false,"pushed_at":"2015-09-06T04:20:50.000Z","size":144,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-05T01:32:44.981Z","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/Planeshifter.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":"2015-09-02T17:08:55.000Z","updated_at":"2019-08-18T16:50:57.000Z","dependencies_parsed_at":"2023-04-07T04:14:26.674Z","dependency_job_id":null,"html_url":"https://github.com/Planeshifter/guess-age","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Planeshifter/guess-age","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fguess-age","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fguess-age/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fguess-age/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fguess-age/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Planeshifter","download_url":"https://codeload.github.com/Planeshifter/guess-age/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Planeshifter%2Fguess-age/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280943424,"owners_count":26417747,"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-10-25T02:00:06.499Z","response_time":81,"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":[],"created_at":"2024-10-12T21:38:19.440Z","updated_at":"2025-10-25T10:43:08.958Z","avatar_url":"https://github.com/Planeshifter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Dependencies][dependencies-image]][dependencies-url]\n\nguess-age\n==========\n\n\u003e Guess the age of a person only from their first name.\n\n## Installation\n\n``` bash\n$ npm install guess-age\n```\n\nFor use in the browser, use [browserify](https://github.com/substack/node-browserify).\n\n\n## Usage\n\n``` javascript\nvar guess = require( 'guess-age' );\n```\n\n#### guess( name[, gender] )\n\nRetrieves the [median](https://en.wikipedia.org/wiki/Median) and [interquartile range](https://en.wikipedia.org/wiki/Interquartile_range) of the age of all persons with a certain `name` estimated to be currently living in the US.\n\n```javascript\nvar out;\n\nout = guess( 'Noah' );\n/*\n\t{\n\t\tmedian: 9,\n\t\tiqr: [ 4, 15.004656730414027 ]\n\t}\n*/\n\nout = guess( 'Jack' );\n/*\n\t{\n\t\tmedian: 50.04038167193148,\n\t\tiqr: [ 11.092877845442404, 70.04441983912463 ]\n\t}\n*/\n```\n\nSince some names can be given to both boys and girls, there is some ambiguity in the gender associated with a `name`. The function supports an optional gender argument which should be used if the `gender` is known. If the `gender` argument is omitted, the statistics are calculated separately for each gender group and then a weighted average is computed based on the distribution of the two genders for persons with the name in question.\n\n```javascript\nout = guess( 'Lindsay', 'male' );\n/*\n\t{\n\t\tiqr: [ 35, 62 ],\n\t\tmedian: 53\n\t}\n*/\n\nout = guess( 'Lindsay', 'female' );\n/*\n\t{\n\t\tiqr: [ 21, 32 ],\n\t\tmedian: 27\n\t}\n*/\n```\n\n## Reference \n\nSee the article on [FiveThirtyEight](http://fivethirtyeight.com/features/how-to-tell-someones-age-when-all-you-know-is-her-name/) which was the inspiration for this module.  The statistics are based on data collected by the Social Security Administration, namely their [actuarial tables](http://www.ssa.gov/oact/NOTES/as120/LifeTables_Tbl_7.html) and data on [birth](https://github.com/datasets-io/male-first-names-us-frequency) [frequencies](https://github.com/datasets-io/female-first-names-us-frequency). \n\n## Examples\n\n``` javascript\nvar guess = require( 'guess-age' ),\n\tout;\n\n// Statistics for Herbert:\nout = guess( 'Herbert' );\n\n// Statistics for Jason:\nout = guess( 'Jason' );\n\n// Statistics for Connor:\nout = guess( 'Connor' );\n```\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n\n## Tests\n\n### Unit\n\nUnit tests use the [Mocha](http://mochajs.org) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n[npm-image]: https://badge.fury.io/js/guess-age.svg\n[npm-url]: http://badge.fury.io/js/guess-age\n\n[travis-image]: https://travis-ci.org/Planeshifter/guess-age.svg\n[travis-url]: https://travis-ci.org/Planeshifter/guess-age\n\n[coveralls-image]: https://img.shields.io/coveralls/Planeshifter/guess-age/master.svg\n[coveralls-url]: https://coveralls.io/r/Planeshifter/guess-age?branch=master\n\n[dependencies-image]: http://img.shields.io/david/Planeshifter/guess-age.svg\n[dependencies-url]: https://david-dm.org/Planeshifter/guess-age\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaneshifter%2Fguess-age","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaneshifter%2Fguess-age","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaneshifter%2Fguess-age/lists"}