JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q24111F
  • License ISC

This package simply allows you to shorten strings to the required character length you input and concats a "..." to the end of the new string.

Package Exports

  • text-trimmer

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 (text-trimmer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Text Trimmer NPM Package

ghosrtcrawl3r - text-trim-npm-package npm version Made with JavaScript License maintained - yes

I created this package because I found myself needing to trim text frequently and using the .concat function to add "..." to the end of text stings for posts, blogs etc within my fullstack applications. Rather than repeatedly making the same helper function for each project, I decided to make this npm package to save my time and hopefully others too.

This package does the following

This package will turn: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquet quam id dui posuere blandit. Curabitur

to a length of your choosing, for example, 20 characters: Lorem ipsum dolor si...

How it works

In this package you have 2 variables you need to enter text and charLength. It's very simple to achieve the above. Call the function textTrimmer(textString, 20); to output a string with a limit of 20 characters

It's important to note that this package will only accept strings! If the string length of the string is shorter than your charLength variable, you will just have your input returned.

How to install

Head to your terminal within your project directory and type:

NPM

$ npm install text-trimmer

YARN

$ yarn add text-trimmer

Thank you for using this package. Enjoy!