array-semantic-join
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Kontentino - Making social media a piece of cake

array-semantic-join by Kontentino

npm NPM

Helper function whose input is an array and output is a semantic string with joined items of the input array.

Installation

$ npm install array-semantic-join or $ yarn add array-semantic-join

Usage

import arraySemanticJoin from 'array-semantic-join';

...
    const userNames = ['John', 'Jane', 'Patrick'];

    ...
    <span>
        {arraySemanticJoin(userNames)} // output: "John, Jane and Patrick"
    </span>

    <span>
        {arraySemanticJoin(userNames, { word: 'a' } )} // output: "John, Jane a Patrick"
    </span>

    <span>
        {arraySemanticJoin(userNames, { word: 'und' } )} // output: "John, Jane und Patrick"
    </span>
...

Docs

Function
arraySemanticJoin(inputArray: Array, options?: { word: String }): String

Package Sidebar

Install

npm i array-semantic-join

Weekly Downloads

119

Version

2.0.1

License

MIT

Unpacked Size

7.76 kB

Total Files

8

Last publish

Collaborators

  • kontentino