0.0.1 • Published 7 years ago

sort-value v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

sort-value

A JavaScript utility library to generate sort values (floating point).

Usage

Install the module:

npm install sort-value --save

ES6

import nameInitials from 'sort-value';

const initials = nameInitials('John Smith');

console.log(initials);
// Output: JS

Pre-ES6

var nameInitials = require('sort-value');

var initials = nameInitials('John Smith');

console.log(initials);
// Output: JS

Input => Output

  • E. => E
  • Eric => E
  • E. Vera => EV
  • Eric V. => EV
  • Eric A. E. => EA
  • Eric A. E. Vera => EV
  • Eric A. Vera => EV
  • Eric A. Vera Perez => EV
  • Eric Vera-Perez => EV
  • Eric A. Vera-Perez => EV
  • Eric Vera Perez => EV
  • Eric A. de Vera Perez => ED
  • Eric A. de Vera-Perez => ED
  • Eric A. Perez-de Vera => EP
  • Eric A. Perez de Vera => EP
  • Eric (Instructor Somewhere) => E
  • Éric Vera => ÉV
  • Vera-Perez => VP
  • Eric "No Nickname" Vera => E

License

MIT

0.0.1

7 years ago