GithubHelp home page GithubHelp logo

ozgurg / akronim Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 665 KB

An acronym generator with useful options.

Home Page: https://npmjs.com/package/akronim

License: MIT License

Shell 1.40% JavaScript 98.60%
acronym generator acikkaynak

akronim's Introduction

Downloads Version

akronim

An acronym generator with useful options.

Install

npm install akronim

This package is a pure ESM package.

Usage

import akronim from "akronim";

akronim("Mustafa Kemal Atatürk");
// "MKA"

akronim("God of War");
// "GOW"

akronim("GitHub");
// "GH"

akronim("Game of Thrones", { ignoreLowercaseWords: true });
// "GT"

akronim("Grand Theft Auto", { separateWith: "." });
// "G.T.A."

akronim("Grand Theft Auto", { separateWith: ".", trimLastSeparator: true });
// "G.T.A"

akronim("To be announced", { capitalize: false });
// "Tba"

API

akronim(text, options) : string

text

Text to generate the acronym.

Note: It will be trimmed with .trim().

Type: string | number
Required: Yes

options

Default: {}
Type: object
Required: No

options.ignoreLowercaseWords

Ignores lowercase words in the input.

Default: false
Type: boolean
Required: No

akronim("Game of Thrones", { ignoreLowercaseWords: true });
// "GT"

options.separateWith

Separates the output with the given value.

Note: It will be trimmed with .trim().

Default: ""
Type: string | number
Required: No

akronim("Grand Theft Auto", { separateWith: "." });
// "G.T.A."

options.trimLastSeparator

Trims the last separator in the output when using with options.separateWith.

Default: false
Type: boolean
Required: No

akronim("Grand Theft Auto", { separateWith: ".", trimLastSeparator: true });
// "G.T.A"

options.capitalize

Capitalizes all letters in the output.

Default: true
Type: boolean
Required: No

akronim("To be announced");
akronim("To be announced", { capitalize: true });
// "TBA"

akronim("To be announced", { capitalize: false });
// "Tba"

License

License

akronim's People

Contributors

ozgurg avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.