JSPM

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

Remove spaces and tabs around line-breaks

Package Exports

  • trim-lines

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 (trim-lines) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

trim-lines Build Status Coverage Status

Remove spaces and tabs around line-breaks.

Installation

npm:

npm install trim-lines

trim-lines is also available for bower, component, duo, and for AMD, CommonJS, and globals (uncompressed and compressed).

Usage

Dependencies.

var trimLines = require('trim-lines');

Trim line-breaks:

var result = trimLines(' foo\t\n\n bar \n\tbaz ');

Yields:

 foo
bar
baz 

API

trimLines(value)

Remove initial and final spaces and tabs at the line breaks in value. Does not trim initial and final spaces and tabs of the value itself.

Parameters:

  • value (string) — Value with untrimmed line breaks, coerced to string.

Returns: string — Value with trimmed line breaks.

License

MIT @ Titus Wormer