https://github.com/primus/condenseify
Browserify transform to remove unwanted blank lines from your code.
https://github.com/primus/condenseify
Last synced: 12 months ago
JSON representation
Browserify transform to remove unwanted blank lines from your code.
- Host: GitHub
- URL: https://github.com/primus/condenseify
- Owner: primus
- License: mit
- Created: 2014-11-11T10:17:46.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-31T19:19:14.000Z (over 3 years ago)
- Last Synced: 2025-06-01T13:15:58.292Z (about 1 year ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# condenseify
[](https://www.npmjs.com/package/condenseify)[](https://github.com/primus/condenseify/actions?query=workflow%3ACI+branch%3Amaster)[](https://coveralls.io/r/primus/condenseify?branch=master)
This module for [Browserify](http://browserify.org/) will transform your js
files condensing multiple blank (empty) lines into a single blank line. By
default non empty lines containing only white spaces will be removed.
## Install
```
npm install --save condenseify
```
## Usage
### Command Line
```sh
browserify main.js -t condenseify > bundle.js
```
### API
Register the [transform](https://github.com/substack/node-browserify#btransformtr-opts).
```js
'use strict';
var condenseify = require('condenseify')
, browserify = require('browserify')
, fs = require('fs');
var b = browserify('main.js');
b.transform(condenseify);
b.bundle().pipe(fs.createWriteStream('bundle.js'));
```
### Options
If you want to keep the blank (non empty) lines you can use the `keep-non-empty`
option. Reusing the examples above, this translates into:
```sh
browserify main.js -t [ condenseify --keep-non-empty ] > bundle.js
```
for the command line and
```js
b.transform(condenseify, { 'keep-non-empty': true });
```
for the API.
## License
[MIT](LICENSE)