truco
Truncate strings.
Truco is a popular trick-taking card game originally from Valencia and Balearic Islands (Spain) and very popular in some countries like Brazil, Argentina, Paraguay and Italy.
Install
Via npm:
$ npm install truco --save
Via Bower:
$ bower install truco --save
Usage
var truco = ; ; // Lorem…; // Lorem***; // …Ipsum
API
truco(string, [limit], [options])
string
Required
Type: string
The string to be truncated.
limit
Type: number
Default: the total length of string
The position where the string should be truncated at.
options
Type: object
Custom options.
options.ellipsis
Type: string
Default: …
The symbol that should be placed at the end/beginning of the truncated string.
options.moonwalk
Type: boolean
Default: false
Wether or not to truncate string from the beginning to the end instead of the opposite.
License
MIT © Rafael Rinaldi