Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yujinlim/grunt-env-check

Automate environment variable checking on your system
https://github.com/yujinlim/grunt-env-check

Last synced: 15 days ago
JSON representation

Automate environment variable checking on your system

Awesome Lists containing this project

README

        

# grunt-env-check

[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/yujinlim/grunt-env-check?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

> Automate environment checking on system

## 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-env-check --save-dev
```

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

```js
grunt.loadNpmTasks('grunt-env-check');
```

## The "env" task

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

```js
grunt.initConfig({
env: {
your_target: {
options: {},
environments: []
}
},
});
```

### Options

#### options.ask
Type: `Boolean`
Default value: `false`

A Boolean value to allow user to set environment variable before proceed to start the application

### Usage Examples
If you set `options.ask` to true, it will prompt user to set it if they do not have it on their working environment
before proceed. In this example, `grunt-env-check` will prompt user to set the environment

```js
grunt.initConfig({
env: {
dev: {
options: {
ask: true
}, {
environments: ['NODE_ENV']
}
}
},
});
```
## 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)_

## License
MIT © [Yu Jin Lim](https://github.com/yujinlim)