3.0.1 • Published 8 years ago

textconv v3.0.1

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

textconv

Build Status Code Climate Code Coverage npm Version JS Standard

Convert texts.

Installation

$ npm install textconv --save

Usage

Chop Text.

Chop text to fit length.

'use strict'

const textconv = require('textconv')

let chopped = textconv.chop('This is a long long text', 18, { ellipsis: true })
console.log(chopped) // => This is a long ...

Inline Text.

Remove line breaks.

'use strict'

const textconv = require('textconv')

let inlined = textconv.inline('This is line 01 \n This is line 02', {trim: true})
console.log(inlined) // => This is line 01 \t This is line 02

Strip Text.

Remove letters from text head and tail.

'use strict'

const textconv = require('textconv')

let dotRemoved = textconv.strip('This dot end text...', /\./)
console.log(dotRemoved) // => This dot end text

License

This software is released under the MIT License.