Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonicdoe/detect-trailing-whitespace
Detect trailing whitespace
https://github.com/sonicdoe/detect-trailing-whitespace
detect javascript nodejs trailing-spaces whitespace
Last synced: 8 days ago
JSON representation
Detect trailing whitespace
- Host: GitHub
- URL: https://github.com/sonicdoe/detect-trailing-whitespace
- Owner: sonicdoe
- License: other
- Created: 2015-01-24T17:53:07.000Z (almost 10 years ago)
- Default Branch: develop
- Last Pushed: 2020-07-20T15:46:07.000Z (over 4 years ago)
- Last Synced: 2024-12-06T18:45:42.035Z (28 days ago)
- Topics: detect, javascript, nodejs, trailing-spaces, whitespace
- Language: JavaScript
- Homepage:
- Size: 195 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# detect-trailing-whitespace
[![npm](http://img.shields.io/npm/v/detect-trailing-whitespace.svg)](https://www.npmjs.com/package/detect-trailing-whitespace)
[![Linux Build Status](http://img.shields.io/travis/sonicdoe/detect-trailing-whitespace.svg)](https://travis-ci.org/sonicdoe/detect-trailing-whitespace)
[![Windows Build Status](http://img.shields.io/appveyor/ci/sonicdoe/detect-trailing-whitespace.svg)](https://ci.appveyor.com/project/sonicdoe/detect-trailing-whitespace)> Detect trailing whitespace
## Installation
```console
$ npm install detect-trailing-whitespace
```## Usage
```js
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](https://semver.org).
- 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.