textconv

3.0.1 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i textconv

Weekly Downloads

1

Version

3.0.1

License

MIT

Last publish

Collaborators

  • okunishinishi