Socket
Socket
Sign inDemoInstall

gender-detection

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gender-detection

Detect the gender of a person using his/her first name.


Version published
Weekly downloads
944
decreased by-10.27%
Maintainers
1
Install size
848 kB
Created
Weekly downloads
 

Readme

Source

Gender Detection

Description

A node.js module to determine a person's gender based on his/her first name.

It works also for many languages other than english, supporting international names, using an own datasource of 40.000 records that can be extended. This module is able to clean the text, detecting gender from dirty or unclear names.

Installation

$ npm install gender-detection

Example

// Require gender detection module
const gender = require('gender-detection');

let g;

// Use it to detect the gender:
g = gender.detect('Tim Johnson');
// "male"

g = gender.detect('Holly');
// "female"

g = gender.detect('GhJGhgj')
// "unknown"

// It works also with unclean or dirty names:
g = gender.detect('BiLL$...');
// "male"

g = gender.detect('::Jenni♥fer::');
// "female"

// Extract the first name
const first_name = gender.getFirstName('Mario Bros');
// "mario"

Unit tests

npm test

Keywords

FAQs

Last updated on 26 Oct 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc