textconv
Convert texts.
Last updated 2 years ago by okunishinishi .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install textconv 
SYNC missed versions from official npm registry.

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.

Maintainers (1)
Downloads
Today 0
This Week 1
This Month 43
Last Day 0
Last Week 21
Last Month 23
Dependencies (0)
None
Dev Dependencies (10)

Copyright 2014 - 2016 © taobao.org |