JSPM

trimmer

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 108
  • Score
    100M100P100Q61876F
  • License MIT

Trim any characters from either side of a string.

Package Exports

  • trimmer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (trimmer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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