gulp-frep
A find and replace utility, using Frep. Replace strings or arrays of strings with an array of replacement patterns.
Last updated 6 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-frep 
SYNC missed versions from official npm registry.

gulp-frep (find and replace) NPM version

A find and replace utility, using Frep. Replace strings or arrays of strings with an array of replacement patterns.

Getting Started

Install the module with: npm install gulp-frep

Usage

var gulp = require('gulp');
var frep = require('gulp-frep');

gulp.task('frep', function() {
  gulp.src('./src/foo.html')
    .pipe(frep(patterns))
    .pipe(gulp.folder('./dist/foo.html'))
});

Example replacement patterns

var patterns: [
  {
    // Strip tags from HTML
    pattern: /(<([^>]+)>)/ig,
    replacement: ''
  },
  {
    // Normalize and condense newlines
    pattern: /(\r\n|\n){2,}/g,
    replacement: '\n'
  }
];

See the frep docs for options.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

Author

License

Copyright (c) 2014 Jon Schlinkert Licensed under the MIT license.

Current Tags

  • 0.1.3                                ...           latest (6 years ago)

4 Versions

  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 5
Dependencies (2)
Dev Dependencies (3)

Copyright 2014 - 2017 © taobao.org |