# grunt-check_env

> check file has need field

Latest version **0.1.4** (published 2016-11-23) · 0 weekly downloads

## Install

```sh
npm install grunt-check_env
pnpm add grunt-check_env
yarn add grunt-check_env
bun add grunt-check_env
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2016-11-23 |
| First published | 2016-11-14 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ligq4 |
| Maintainers | ligq4 |
| Keywords | gruntplugin |

## Links

- npm: https://www.npmjs.com/package/grunt-check_env
- Repository: https://github.com/ligq4/gruntplugin
- Issues: https://github.com/ligq4/gruntplugin/issues
- npm.io page: https://npm.io/package/grunt-check_env

## Recent versions

- 0.1.4 (latest) — 2016-11-23
- 0.1.3 — 2016-11-23
- 0.1.2 — 2016-11-17
- 0.1.1 — 2016-11-14
- 0.1.0 — 2016-11-14

## README

# grunt-check_env

> 将指定(words)的关键字替换成自定义的关键字(replaceStr)

## Getting Started
This plugin requires Grunt `~0.4.5`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-check_env --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-check_env');
```

## The "check_env" task

### Overview
In your project's Gruntfile, add a section named `check_env` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  check_env: {
    options: {
     words: '',//被替换的关键字，支持一行多个单词替换
      replaceStr:'',//替换后的关键字
    },
    your_target: {
      // Target-specific file lists and/or options go here.
      'key':[]  //key:替换后生成文件的路径     []:数组格式化的文件支持三种格式，1.单个文件，文件夹，文件夹下面指定的文件格式 forexample  123.js  tests/   test/*.js
    }
  }
});
```

### Options

#### options.separator
Type: `String`
Default value: `',  '`

A string value that is used to do something with whatever.

#### options.punctuation
Type: `String`
Default value: `'.'`

A string value that is used to do something else with whatever else.

### Usage Examples

#### Default Options
In this example, the default options are used to do something with whatever. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result would be `Testing, 1 2 3.`

```js
grunt.initConfig({
  check_env: {
    options: {},
    files: {
      'dest/default_options': ['src/testing', 'src/123'],
    },
  },
});
```

#### Custom Options
In this example, custom options are used to do something else with whatever else. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result in this case would be `Testing: 1 2 3 !!!`

```js
grunt.initConfig({
  check_env: {
   custom_options: {
           options: {
             words: 'uat',
             replaceStr:'test',
             file_path:''//文件路径
           },
           files: {
             'tmp/custom_options': ['tests/*.js']//key 文件生成的目录，value 要格式化的文件支持三种格式，1.单个文件，文件夹，文件夹下面指定的文件格式 forexample  123.js  tests/   test/*.js
           }
         }
  }
});
```

## 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](http://gruntjs.com/).

## Release History
_(Nothing yet)_

---
_Source: https://npm.io/package/grunt-check_env · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
