JSPM

predentation

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

A stream for removing indentation from the pre tag

Package Exports

  • predentation

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

Readme

predentation

Build Status

A node.js stream that removes indentation from the pre tag.

Before:

<html>
  <body>
    <pre>
      function something() {
          return 'Hello, World!';
      }
    </pre>
  </body>
</html>

After:

<html>
  <body>
    <pre>
function something() {
    return 'Hello, World!';
}
    </pre>
  </body>
</html>

Installation

Install globally or locally with NPM, or clone this repository with Git.

Usage

Shell

Process a single file

predentation index.html > output/index.html

Use your shell to glob and output files with the same name to a directory

predentation *.html -o output

Supports globbing internally so pass globs as a string to be platform agnostic

predentation '**/*.html' -o output

Pipe in and pipe out

cat index.html | predentation | minify > output.html

Options

These options are available to the CLI only:

-o --output: Output directory (use redirection > for a single file)

Build Tools

Please do not create a plugin for this unless it is absolutely necessary!

Gulp

Use vinyl-transform to wrap predentation, and use like any other plugin.

var gulp         = require('gulp');
var transform    = require('vinyl-transform');
var predentation = require('predentation');

var pre = transform(function (options) {
  return predentation(options);
});

gulp.task('default', function () {
  gulp
  .src('input.html')
  .pipe(pre)
  .pipe(gulp.dest('output'));
});

Others

If the only way to include this as part of your build is to make a plugin, then by all means make one and list it here.