Skip to content

kristianmandrup/grunt-sed

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Dependency Status devDependency Status

grunt-sed

This is a fork of the original repo with the changes we needed since things were going pretty slow upstream.

Built on top of replace, grunt-sed is a Grunt plugin for performing search and replace on files.

Usage

This plugin is a multi task, meaning that Grunt will automatically iterate over all exec targets if a target is not specified.

Properties

  • path - File or directory to search. Defaults to '.'.
  • pattern - String or regex that will be replaced by replacement. Required.
  • replacement - The string that will replace pattern. Can be a function. Required.
  • recursive - If true, will recursively search directories. Defaults to false.
  • include - String or array of files to include.
  • exclude - String or array of files/folders to exclude.

Example

grunt.initConfig({
  pkg: grunt.file.readJSON('package.json'),

  sed: {
    version: {
      pattern: '%VERSION%',
      replacement: '<%= pkg.version %>',
      recursive: true,
      exclude: ['*.min.js', 'node_modules']
    }
  }
});

License

Copyright (c) 2013 Jake Harding
Licensed under the MIT License.

About

Grunt plugin for search and replace.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%