textconv
v3.0.1
Published
Convert texts.
Downloads
28
Readme
textconv
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.