1.1.1 • Published 5 years ago
nameable v1.1.1
Nameable
Format and truncate names of people.
Getting Started
npm install --save nameable
Setup
Set the configuration for the whole project.
const nameable = require('nameable')
nameable.config({
firstKey: 'firstName',
middleKey: 'middleName',
lastKey: 'lastName',
})
Usage
const nameable = require('nameable')
const person = {
firstName: 'John',
middleName: 'Wayne',
lastName: 'Smith',
}
const name = nameable.new(person)
console.log(name.format('Last, First M.')) // Smith, John W.