0.3.0 • Published 10 years ago

gulp-substituter v0.3.0

Weekly downloads
15
License
MIT
Repository
github
Last release
10 years ago

gulp-substituter Build Status

Replace matched strings in files for defined values

Install

$ npm install --save-dev gulp-substituter

Gulp Usage

gulpfile.js

var sprites = require('gulp-substituter');

gulp.task('replace', function() {
  return gulp.src('index.html')
    .pipe(substituter({
      title: 'website'
    }))
    .pipe(gulp.dest('dist'))
});

index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title><!-- substitute:title --></title>
</head>
<body>
</body>
</html>

API

substituter(options)

Options

Object of keys that you want to replace

Predefined keys
__start

Type: String Default: <!--

Start tag for matching values

__end

Type: String Default: -->

End tag for matching values

__prefix

Type: String Default: substitute

prefix before key

Example

{
  title: 'website',
  description: 'sample website',
  analytics: 'example-123'
}

License

MIT license

0.3.0

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago