textconv
Convert texts.
Last updated 2 years ago by okunishinishi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ 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.

Current Tags

  • 3.0.1                                ...           latest (2 years ago)

7 Versions

  • 3.0.1                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 7
Last Month 15
Dependencies (0)
None
Dev Dependencies (10)

Copyright 2014 - 2016 © taobao.org |