Package to determine gender by name. Some database doest not have GENDER intel, so it can be very helpful a lib that can predict gender based on a person's first name. Be aware, this lib was built upon Brazilians census. So it will work with Brazilian nam
npm install br-gender 
While I was searching for a NodeJS library that could predict a person gender by its name, I've come across this blog: https://fmeireles.com/blog/rstats/genderbr-predizer-sexo/
So it gave me the idea I need to build up my own lib, since I didn't find anything similar in npm.
Original library has a lot of options that don't suit my project, so I didn't write them down. Maybe one day.
You can install the package via npm or yarn
``bash`
npm install br-gender
`bash`
yarn add br-gender
Usage is pretty straightforward. Import getGenderByName from package and pass a name to it.
`js
import { getGenderByName } from 'br-gender';
const gender = await getGenderByName('Thiago');
// OUTPUT: 'Male'
`
You can also pass a boolean property to get back the percentual of gender over every entry:
`js
import { getGenderByName } from 'br-gender';
const gender = await getGenderByName('Thiago', { percentage: true });
// OUTPUT: { gender: 'Male', percentage: 99.30}
``
Basically, it searches the brazilian census API with the given name and sum all occurrences from both genders, male and female.
For example, if the given name is 'Thiago', it will perform a search from both genders and sum them. If the male percentage is greater than 95% over the total, so the gender of the name should be male.
I know it isn't perfect, but it suited my project back in the day.
- Thiago Vasconcellos - _Initial work_ - brzipcode
This project is licensed under the MIT License - see the LICENSE.md file for details
QW\*wR9B!Ew5k;nv