JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q50318F
  • License MIT

Generate your very own acronyms!

Package Exports

  • acronym

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (acronym) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

acronym

Build Status Test Coverage

Generate your very own acronyms!

Use it for generating version tags, committee designations, or even band names!

Uses more-words.

Install

$ npm install --save acronym

Usage

Generate acronym from a string:

import acronym from 'acronym'
acronym('npm')
// => 'Nice Promise Mistakes'

Generate acronym from an array of strings:

import acronym from 'acronym'
const words = [
  'wut',
  'bird',
  'noodle'
];
acronym(words)
// => [ 'Wins Unapproved Thrilled',
// =>  'Boring Irresistibile Raptures Disaster',
// =>  'Novel Oversell Outcry Devastated Lack Endorse' ]

Options

Pass in options via a second parameter to the acronym() function

capitalize

Determines wether the first letter of each word in the acronym will be capital. Default is true.

import acronym from 'acronym'
const options = {
  capitalize: true
}
acronym('npm', options)
// => 'No Pleasure Misbehaving'
import acronym from 'acronym'
const options = {
  capitalize: false
}
acronym('npm', options)
// => 'no profiteer misreporting'

separator

Determines the string between each word in the acronyn. Default is a single space.

import acronym from 'acronym'
const options = {
  separator: ', '
}
acronym('npm', options)
// => 'Nasty, Preventing, Mocked'
import acronym from 'acronym'
const options = {
  separator: '-',
  capitalize: false
}
acronym('npm', options)
// => 'needy-positive-mercy'

License

MIT © Pat Lillis