trimmer

Trim any characters from either side of a string.

Stats

StarsIssuesVersionUpdatedCreatedSize
trimmer
212.0.05 years ago9 years agoMinified + gzip package size for trimmer in KB

Readme

Trimmer

NPM version Build status Test coverage Greenkeeper badge

Trim characters from either side of a string.

Installation

npm install trimmer --save

API

var trim = require('trimmer')
  • trim(string [, characters])
  • trim.left(string [, characters])
  • trim.right(string [, characters])

P.S.: characters can be one of either an string, array or function.

trim('  test  ') //=> 'test'
trim.left('  test  ') //=> 'test  '
trim.right('  test  ') //=> '  test'

trim('test', 't') //=> 'es'
trim('testing', 'ing') //=> 'test'
trim.left('test', 't') //=> 'est'
trim.right('test', 't') //=> 'tes'

License

MIT

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.