2.0.13 • Published 1 year ago
split-human-name v2.0.13
split-human-name
Split a person's name into first name and last name fields
Features
- Splits a name into exactly two fields
{ firstName, lastName }
- Fixes UPPERCASE, lowercase, iNVERSE CASE, and otherwise FUnkY cAse
- Handles couples ("John and Jane Doe")
- Gracefully degrades to put the entire string in
firstName
if there are multiple last names
Based on the awesome humanparser and namecase packages
Online demo: http://compwright.com/demos/split-human-name
Requirements
- Node.js 10+
Installation
$ npm install --save split-human-name
Usage Examples
Browser
<script src="https://unpkg.com/split-human-name@latest/dist/split-human-name.min.js"></script>
<script>
console.log(window.splitHumanName('John and Jane Doe'));
</script>
Node
const splitName = require('split-human-name');
const { firstName, lastName } = splitName('John and Jane Doe');
assert.strictEquals(firstName, 'John and Jane');
assert.strictEquals(lastName, 'Doe');
License
MIT
2.0.13
1 year ago
2.0.12
2 years ago
2.0.11
2 years ago
2.0.10
2 years ago
2.0.9
3 years ago
2.0.8
3 years ago
2.0.7
3 years ago
2.0.5
3 years ago
2.0.4
3 years ago
2.0.3
3 years ago
2.0.2
3 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.0.5
4 years ago
1.0.4
5 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago