2.2.0 • Published 4 months ago

shortfield v2.2.0

Weekly downloads
15
License
MIT
Repository
github
Last release
4 months ago
CI / CDStatus
NPMnpm version
Semaphore CIBuild Status
Circle CICircleCI
CoverallCoverage Status
SonarCloudQuality Gate Status

shortfield returns a string truncated after X characters (default 10), concatenated with "..." (three dots).

Useful in tables with long strings.

E.g. "This is a long string" will return "This is a ..."

Installation

npm install @sineverba/shortfield

Usage

import { Shortener } from "shortfield";

var shorted = Shortener("This is a long string"); // default length is 10
console.log(shorted); // returns This is a ...

var shorted = Shortener("This is a long string", 4);
console.log(shorted); // returns This...

Tests

npm run test for simple test

npm run coverage for coverage

2.2.0

4 months ago

2.1.0

10 months ago

1.3.1

1 year ago

2.0.0

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.1

2 years ago

1.0.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago