Skip to content

sonicdoe/detect-trailing-whitespace

Repository files navigation

detect-trailing-whitespace

npm Linux Build Status Windows Build Status

Detect trailing whitespace

Installation

$ npm install detect-trailing-whitespace

Usage

const fs = require('fs');
const detectTrailingWhitespace = require('detect-trailing-whitespace');

const fileContents = fs.readFileSync('file.txt', 'utf8');
const containsTrailingWhitespace = detectTrailingWhitespace(fileContents);

console.log(containsTrailingWhitespace);
// => `true` if file contains trailing whitespace, otherwise `false`

Changelog

This project follows Semantic Versioning 2.

  • v1.0.0 (2017-07-23):
    • Add support for Node.js v6, v8, and v10.
    • Drop support for Node.js versions older than v6.
  • v0.1.0 (2015-01-24): Initial release.