1.3.1 • Published 9 years ago

truco v1.3.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

truco Build Status

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 = require('truco');

truco('Lorem Ipsum', 5); // Lorem…
truco('Lorem Ipsum', 5, {ellipsis: '***'}); // Lorem***
truco('Lorem Ipsum', 5, {moonwalk: true}); // …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 moonwalker

Type: boolean
Default: false

Wether or not to truncate string from the beginning to the end instead of the opposite.

License

MIT © Rafael Rinaldi

1.3.1

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.1

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago