grunt-copy-replace

0.1.1 • Public • Published

grunt-copy-replace

Find certain test in a file and use it to replace target text in another file

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-copy-replace --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-copy-replace');

The "copy_replace" task

Overview

In your project's Gruntfile, add a section named copy_replace to the data object passed into grunt.initConfig().

grunt.initConfig({
  copy_replace: {
    options: {
      // Task-specific options go here.
    },
    files: {
      // Speciify source and destination files.
      // Support only one source and one destination file now.
    },
  },
});

Options

options.srcPattern

Type: String Default value: null

A string value that is used to create regex object which is used to find certain text in source file.

options.destPattern

Type: String Default value: null

A string value that is used to create regex object which is used to find target text in destination file.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

0.1.0: first release, basic functions. 0.1.1: minor changes.

Readme

Keywords

Package Sidebar

Install

npm i grunt-copy-replace

Weekly Downloads

1

Version

0.1.1

License

none

Last publish

Collaborators

  • junqi