2.2.1 • Published 5 months ago

shortfield v2.2.1

Weekly downloads
15
License
MIT
Repository
github
Last release
5 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 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...
2.2.1

5 months ago

2.2.0

1 year ago

2.1.0

2 years ago

1.3.1

2 years ago

2.0.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.1

3 years ago

1.0.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago