{"id":13625117,"url":"https://github.com/AdesisNetlife/croak","last_synced_at":"2025-04-16T06:31:45.893Z","repository":{"id":10693800,"uuid":"12935972","full_name":"AdesisNetlife/croak","owner":"AdesisNetlife","description":"Grunt made easy for large and distributed projects (deprecated)","archived":false,"fork":false,"pushed_at":"2014-04-20T20:06:14.000Z","size":1028,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-29T01:03:38.237Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"LiveScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdesisNetlife.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-18T22:19:34.000Z","updated_at":"2021-06-07T12:50:11.000Z","dependencies_parsed_at":"2022-08-05T13:17:56.634Z","dependency_job_id":null,"html_url":"https://github.com/AdesisNetlife/croak","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdesisNetlife%2Fcroak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdesisNetlife%2Fcroak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdesisNetlife%2Fcroak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdesisNetlife%2Fcroak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdesisNetlife","download_url":"https://codeload.github.com/AdesisNetlife/croak/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223700245,"owners_count":17188279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:51.070Z","updated_at":"2024-11-08T14:30:29.273Z","avatar_url":"https://github.com/AdesisNetlife.png","language":"LiveScript","funding_links":[],"categories":["LiveScript"],"sub_categories":[],"readme":"# Croak [![Build Status](https://secure.travis-ci.org/AdesisNetlife/croak.svg?branch=master)][9] [![Dependency Status](https://gemnasium.com/AdesisNetlife/croak.svg)][10] [![NPM version](https://badge.fury.io/js/croak.svg)][11] [![Roadchange](https://roadchange.com/AdesisNetlife/croak/badge.svg)][12]\n\n\u003e Grunt made easy for large projects. It's like One Ring to rule them all, but for Grunt\n\n**Disclaimer**:\nCroak is still an initial version, but it's ready-to-use in relaxed environments\n\n## About\n\n\u003cimg align=\"right\" height=\"280\" src=\"http://oi44.tinypic.com/f3azc7.jpg\" style=\"float: right\" /\u003e\n\n[Grunt][1] is an awesome task runner and build automation tool largely adopted for [node.js][7]\n\nCroak is just a simple, but featured wrapper for Grunt that aims to help you to manage\nand orchestrate Grunt tasks configuration (aka Gruntfile) in large and distributed projects,\nhelping you to avoid redundancy, saving time and reducing dramatically changes impact\nduring the project life-cycle and development workflow\n\n### Features\n\n- Allows you to centralize your Gruntfile in one place and use it from many places\n- Easily manages and orchestrates different configuration for multiple projects\n- Avoid redundant Grunt configuration over multiple repositories\n- Abstracts and provides more control for Grunt tasks configuration\n- Support to use and discover global node packages as Grunt configuration package\n- Extends or overwrites global Gruntfile from local configuration\n- Provides the same Grunt API and very similar CLI (things won’t change too much)\n- Customizes Grunt execution options from a config file (future `.gruntrc`)\n- You don’t need to have Grunt NPM task locally installed in order to run tasks\n\n## Installation\n\nIt is recommended that you install Croak as global package:\n```shell\n$ npm install croak -g\n```\n\nThen, create the configuration file:\n```\n$ croak init -g\n```\n\nThe above command will create a `.croakrc` file in your user home directory, as global configuration.\n\nStill confused? Please, take some minutes to read the detailed documentation below\n\n\n## Table of Contents\n\n- [Why we created Croak?](#why-we-created-croak)\n  - [When do I NOT need it?](#when-do-i-not-probably-need-it-)\n  - [When do I need it?](#when-do-i-need-it)\n- [How it works](#how-it-works)\n  - [Example use case scenario](#example-use-case-scenario)\n  - [Can abstraction be dangerous?](#can-abstraction-be-dangerous)\n- [Current stage](#current-stage)\n  - [Grunt support](#grunt-support)\n- [Using Croak](#using-croak)\n  - [Configuration file](#configuration-file)\n    - [Global config](#global-config)\n    - [Local config](#local-config)\n    - [Available config options](#available-configuration-options)\n      - [Global options](#global-options)\n      - [Croak-specific](#croak-specific)\n      - [Grunt-specific](#grunt-specific)\n  - [Switching to Croak](#switching-to-croak)\n    - [Adapting your existing Gruntfile](#adapting-your-existing-gruntfile)\n    - [Use Croak from an existing Gruntfile](#use-croak-from-an-existing-gruntfile)\n  - [Croakfile](#croakfile)\n  - [Command-line interface](#command-line-interface)\n    - [Running tasks](#running-grunt-tasks)\n    - [Configuration](#configuration)\n  - [Programmatic API](#programmatic-api)\n- [FAQ](#faq)\n- [Development](#development)\n- [Contributing](#contributing)\n- [To Do/Wish list](#to-dowish-list)\n- [Contributors](#Contributors)\n- [License](#license)\n\n\u003c!--\n [Caveats](#caveats)\n--\u003e\n\n## Why we created Croak?\n\nCroak arises from the need to create a specific solution to abstract all the automation configuration stuff. It allows you to delegate responsibilities properly in your project to the developers, without losing the desired level of control and centralization.\n\nBecause a design principle, node.js (and consequently Grunt) packages and its dependencies are locally installed, and that is fantastic. However, this is not always the best choice for some scenarios.\nAs you probably already know, dependencies globalization in node.js can be considered an anti-pattern, but globalization can be an ideal choice if you are in a big and distributed project.\n\nWhen a project have a considerable number of repositories, by inertia you probably tend to\nuse the local packages and configuration across each different repository, but these configurations are usually equal\nor very similar for each different repository.\n\nThe above project scenario is really hard to maintain when you need to apply\nchanges massively in your project, like automation, building or deployment configuration changes that is completely usual during the project evolution\n\nCroak is created to supply this need. It aims to provide a specific solution to easily centralize and orchestrate Grunt configuration, so that you can rapidly apply massive changes in your project.\n\nCroak has basically two main goals:\n\n- Reduces the Grunt configuration changes impact during your project life-cycle\n- Gives configuration control and provides abstraction to developers, without hurting their feelings\n\n### When do I NOT (probably) need it?\n\n- When you have only one or two repositories in your project\n- When you have an ultra specific grunt config on each project repository\n- When you or your team don’t want to spend time updating/synchronizing build configuration\n- When you don’t need to centralize and (consequently) don’t need to take the control\n- When you have a lot of free time and you enjoy doing redundant and not very interesting tasks\n- When developers of your project... (at least one):\n  - are ultra skilled and responsible guys\n  - have a lot of time to maintain their own automation tasks configuration\n  - need to take full control of the automation tasks configuration\n\n### When do I need it?\n\n- When you want to centralize and take control of the project building and automation configuration\n- When you want to reduce the configuration change time and impact in your project\n- When your project have a considerable number of repositories (more than 3)\n- When your project configuration is equal or very similar in different repositories\n- When you want to keep clean each repository of Grunt tasks\n- When you do NOT want to spend time doing redundant and not very funny stuff\n- When you do not want to spend much time providing support to developers about configuration stuff\n- Or whatever is not on the 'When do I not need' list...\n\n## How it works\n\nIn a few words, Croak allows you to have a multiple `Gruntfile` in global locations and runs them using a simple project identifier (like a linker). It also allows you to define pre-configured options to pass to Grunt in a simple configuration file\n\nMoreover, Croak allows you to extend or overwrite Gruntfile configurations, so you can provide a way to customize tasks configuration from local configuration (see the [Croakfile](#croakfile) section)\n\n### Example scenario\n\nA representative scenario could be, for example, that your project has a relevant\nnumber of repositories. Each repository needs its automation configuration\nfor development, testing or building stuff.\n\nUsually, this configuration tends to grow when your repository has a certain amount of different tasks and it also tends to be very similar or redundant in different repositories in your project\n\nFor example you could need the same tasks in your project to run tests, generate documentation,\nstatically analyze the code, generate a coverage report or measure the code complexibility\n\nContinuous changes and improvements are a permanent feature in any software project, and Croak just helps with that\n\nYou can see a complete example project structure using Croak [here][6]\n\n### Can abstraction be dangerous?\n\nAbstraction is not always the best choice and some people can hate it.\nBasically, an abstraction in software development tries to reduce notably the complexity,\nunderlines details and gives more control\n\nWith Croak you can provide an ideal level of abstraction to developers without losing  control and,\nadditionally, give them freedom if they want to customize or extend Grunt configuration allowing them to\nadapt it to their needs\n\nIf you want to make less impact to the developers, take a look to the [Croak Grunt faker][14]\n\n## Current stage\n\nCroak is an initial ready-to-use version, though it’s under active development process and important changes can be done in a near future version\n\n#### Grunt support\n\nCroak supports Grunt `~0.4.0`\n\n## Using Croak\n\n### Configuration file\n\nCroak uses disk files to store persistently the configuration. The Croak configuration file must be called `.croakrc`\n\nCroak supports two types of configuration files\n\n#### Global config\n\nA global file can store your project configuration and this configuration will be used in each Croak execution\n\nIt will be located in the user home directories by default.\n\nIf you want to define a global cross-user shared configuration, you can define `CROAKRC` environment variable in order\nto specify a custom global file location, instead of the current user home directory\n\n#### Local config\n\nLocal file can be located in any path, but it’s recommended that you create it in your project or repository root folder\n\nUsually, a local file should have only one project configured.\nAny local configuration has priority and will overwrite global configuration (for example, if you configure the same project in both files)\n\nCroak implements a similar file discovery algorithm like the one Grunt uses to discover the Gruntfile\n\n### Available configuration options\n\n#### Global config\n\n| Name           | Type      | Default     | Description                                    |\n| -------------- | --------- | ----------- | ---------------------------------------------- |\n| $default       | `string`  | undefined   | Project to use by default when no project is defined. Useful to use in local configuration and avoiding to pass the `--project` flag via CLI |\n\n#### Per-project config\n\n##### Croak-specific\n\n| Name              | Type      | Default     | Description                                    |\n| ----------------- | --------- | ----------- | ---------------------------------------------- |\n| package           | `string`  | undefined   | Node package which contains the Gruntfile. It will be resolved as local and global package. This is a recommended alternative to the `gruntfile` option |\n| extend         | `boolean` | false       | Enable extend existing tasks from Croakfile |\n| overwrite      | `boolean` | false       | Enable overwrite existing tasks from Croakfile |\n| register_tasks | `boolean` | false       | Enable register/create new tasks from Croakfile |\n\u003c!--\n| cwd            | `string`  | ${PWD}      | Working directory to pass to Grunfile. Default to ${PWD} or local `.croakrc` path. Don't use this option unless you know what you are doing |\n--\u003e\n\n##### Grunt-specific\n\nThe following options will be (probably) available in Grunt in future versions, inside a file called `.gruntrc`, however, Croak already supports it\n\n| Name           | Type      | Default     | Description                                    |\n| -------------- | --------- | ----------- | ---------------------------------------------- |\n| gruntfile      | `string`  | undefined   | Path to your Gruntfile. It can be a relative path. You should define this option in all of your projects. If you define the `package` option, Gruntfile path will be relative to the `package` root directory. By default, Croak tries to find it in the package root folder or inside the `grunt` directory. You only need to use this option with `package` if your Gruntfile exist in a custom directory |\n| base           | `string`  | undefined   | Specify an alternate base path. By default, all file paths are relative to the Gruntfile |\n| no_color       | `boolean` | false       | Disable colored output |\n| debug          | `boolean` | false       | Enable debugging mode for tasks that support it |\n| stack          | `boolean` | false       | Print a stack trace when exiting with a warning or fatal error |\n| force          | `boolean` | false       | A way to force your way past warnings. Don’t use this option, fix your code |\n| tasks          | `string`  | undefined   | Additional directory paths to scan for task and \"extra\" files |\n| npm            | `string`  | undefined   | Npm-installed grunt plugins to scan for task and \"extra\" files |\n| no_write       | `boolean` | false       | Disable writing files (dry run) |\n| verbose        | `boolean` | false       | Verbose mode. A lot more information output |\n\n\nYou can use any of the config options also as a command line flag. See the Grunt CLI [documentation][1]\n\n##### Example file configuration\n\nA multi-project `.croakrc` configuration file\n\n```ini\n$default = my-project\n\n[super-project]\nextend = true\ngruntfile = ${HOME}/projects/super-project/build/Gruntfile.coffee\ndebug = true\nstack = true\n\n[my-project]\nextend = true\noverwrite = true\nregister_tasks = true\n; resolve an node package in the system locally and globally installed\n; then Croak will try to discover the Gruntfile inside the package directory\npackage = my-project-builder\n; grunt-specific\nbase = ${HOME}/projects/my-project/my-package/\nno_color = false\nno_write = false\ndebug = false\nverbose = false\nforce = true\nstack = true\ntasks = ../custom-tasks/\nnpm = mytask\n```\n\nYou can use any existing environment variables in config values, using the `${VARIABLE_NAME}` notation\n\n##### Notes about cross-OS variables\n\nIn order to use the same config values across diferent OS, Croak will transparently translate\ncommon environment variables to the specific running OS\n\nFor example, if your use `${HOME}`, Croak will translate it into `%USERPROFILE%` under Windows and viceversa.\nThe same case is applied for `${PWD}`, `${TMPDIR}`, `%HOMEDRIVE%`, translating this last one into `/` under Unix-like OS\n\n##### Built-in Croak variables\n\nAdditionally, Croak introduces support for an easy way to use relative paths from Croak-specific files locations,\nlike the `.croakrc` config file path\n\n| Variable       | Value |\n| -------------- | ------------------------------------------------- |\n| CROAKRC_PATH   | Absolute path to the `.croakrc` local file. If it doesn’t exist, $PWD will be used instead |\n\u003c!--\n| GRUNTFILE_PATH | Absolute path to the used `Gruntfile`. If it doesn’t exist, ${PWD} will be used instead |\n| CROAKFILE_PATH | Absolute path to the used `Croakfile`. If it doesn’t exist, ${PWD} will be used instead |\n--\u003e\n\n## Switching to Croak\n\n### Adapting your existing Gruntfile\n\nCroak will automatically expose the croak object in Gruntfile, so you can use this\nconfiguration like template values in your tasks config\n\nThis is really useful because, in much cases, you need to use absolute paths in your Gruntfiles\n\n**Croak grunt object**\n\nThe following properties will be available as Croak task in Grunt.\nYou can use it as Grunt templating in tasks configuration. If you don't use the `base` option, you should use one of the\nfollowing options to configure your tasks in order to use absolute paths\n\n| Option         |  Description |\n| -------------- | ------------------------------------------------- |\n| **cwd**        | Absolute path to the current user working directory from where Croak was called  |\n| **root**       | Absolute path to the existing `Croakfile` or `.croakrc` directory. If both files don’t exists, cwd will be used instead |\n| **config**     | Absolute path to the local .croakrc file directory. If it doesn’t exist, it will be null |\n| **base**       | Configured base path. If the base options doesn’t exist, cwd will be used |\n| **gruntfile**  | Absolute path to the current used Gruntfile |\n| **croakfile**  | Absolute path to the current used Croakfile, if it exists |\n| **version**    | Current Croak version |\n| **npm**        | Grunt npm load packages |\n| **tasks**      | Grunt tasks load path |\n| **options**    | Croak current config options object |\n\nThe above properties will be also available from `grunt.croak` object\n\n**Example Gruntfile**\n\n```js\nmodule.exports = function (grunt) {\n  if (grunt.croak) {\n    grunt.log.writeln('Running Grunt from Croak (v.' + grunt.croak.version + ')');\n  }\n\n  grunt.initConfig({\n    clean: {\n      options: {\n        force: true\n      },\n      views: '\u003c%= croak.cwd %\u003e/tmpl/'\n      tmp: '\u003c%= croak.root %\u003e/.tmp/'\n    },\n    jshint: {\n      options: {\n        jshintrc: '.jshintrc'\n      },\n      all: [\n        '\u003c%= croak.base %\u003e/src/scripts/{,*/}*.js'\n        '\u003c%= croak.config %\u003e/demo/{,*/}*.js'\n        '!\u003c%= croak.root %\u003e/src/scripts/vendor/*.js'\n      ]\n    },\n    connect: {\n      server: {\n        options: {\n          port: 9001,\n          base: '\u003c%= croak.root %\u003e'\n        }\n      }\n    }\n  });\n};\n```\n\n#### Use Croak from an existing Gruntfile\n\n**The Croak Grunt task is still in progress**\n\n\u003c!--\nIf you already have `Gruntfile.js` in each local repository of your project and you don’t want to switch\nradically to Croak, you can use the `grunt-croak` task to have a smaller configuration impact\nwith the same result\n\n##### Install the task\n\n```\n$ npm install grunt-croak --save-dev\n```\n\n##### Add it in your Gruntfile\n\n```\ngrunt.loadNpmTasks('grunt-croak')\n\ngrunt.initConfig({\n  croak: {\n    my_project: {\n      options: {\n        gruntfile: 'path/to/Gruntfile.js',\n        verbose: true\n      }\n    }\n  }\n})\n```\n\nFor more information, see the [grunt-croak][2] documentation\n--\u003e\n\n### Croakfile\n\nLike Grunt, Croak has its own specific tasks configuration file.\n\nThe Croakfile has the same API as Grunt and it can also be a JavaScript or CoffeeScript file. The module should export a `function`, like in Grunt\n\nThe idea behind the Croakfile is to provide an isolated configuration file without conflicting with Gruntfile\nfor specifically extend or overwrite Grunt tasks configuration from local config to global config\n\nIf the Croak project configuration allows `extend` or `overwrite` Grunt config, you can use the Croakfile to\ncustomize and overwrite globally configured tasks to adapt it to your needs\n\n```js\nmodule.exports = function (croak) {\n\n  croak.log.ok('Version:', croak.version)\n  croak.log.ok('Grunt version:', croak.grunt.version)\n\n  croak.extendConfig({\n    log: {\n      foo: {},\n      bar: 'hello croak'\n    },\n    read: {\n      files: [\n        '\u003c%= croak.root %\u003e/file.json'\n        __dirname + '/another-file.json'\n      ]\n    }\n  })\n\n  // you can also register new tasks if 'register_tasks' option is enabled\n  croak.registerMultiTask('log', 'Log stuff.', function() {\n    grunt.log.writeln(this.target + ': ' + this.data)\n  })\n\n  croak.registerMultiTask('read', 'Read file.', function() {\n    grunt.log.writeln(this.target + ': ' + this.data)\n  })\n\n  croak.registerTask('default', ['log'])\n\n}\n```\n\n#### Croakfile API\n\nThe Croakfile API inherits from Grunt API.\nYou can do the same thing in a Gruntfile. Please, see the [Gruntfile documentation][13] for more information\n\nAdditionally, Croak provides the next useful and Grunt missing API\n\n##### croak.extendConfig(config)\nAlias to grunt.initConfig(), but just for a more semantic usage from Croakfiles\n\n##### croak.task.exists()\nCheck if a tasks were already registered and exist\n\n##### croak.grunt\nExposes the native Grunt API module object.\nIf you use directly the Grunt API, for example, to register new tasks or remove config, Croak will not control if you can do it.\nUse it under your own reponsibility\n\n### Command-line interface\n\nCroak provides a straightforward CLI that allows you to do almost everything (including all that you can do with Grunt CLI).\n\nAditionally, if you are convervatory and you want to use Croak keeping the same native Grunt CLI interface,\ntake a look to the [Croak Grunt faker][14]\n\n```\n  Usage: croak [options] [command]\n\n  Commands:\n\n    help\n      Output the usage information\n    version\n      Output the version information\n    init [options] [name]\n      Create new projects in .croakrc\n    config [options] \u003caction\u003e [key] [value]\n      Read/write/update/remove croak config\n    run [options] [task]\n      Run Grunt tasks\n    add [options] [name]\n      Add new projects in .croakrc\n\n  Options:\n\n    -h, --help     output usage information\n    -V, --version  output the version number\n\n  Usage examples:\n\n    $ croak init [name]\n    $ croak add [name]\n    $ croak config [create|list|get|set|remove]\n    $ croak run task\n    $ croak grunt task\n\n  Command specific help:\n\n    $ croak \u003ccommand\u003e --help\n\n  Grunt help:\n\n    $ croak grunt --help\n\n```\n\n#### Running Grunt tasks\n\n```\n$ croak run task -p my-project\n```\nYou need to pass the `-p` flag if there’s not a `.croakrc` local config file\n\nYou can configure the default project to use from a local config file, like this:\n```ini\n$default = my-project\n```\nThen you can simply run:\n```\n$ croak run task\n```\n\nYou can also run subtasks:\n```\n$ croak run task:subtask\n```\n\nor multiple tasks:\n```\n$ croak run task anothertask\n```\n\n#### Configuration\n\nShow the current existing config\n```\n$ croak config list\n```\n\nCreate a config file (add `-g` flag to create it globally)\n```\n$ croak config create\n```\n\nYou can CRUD config values easily from CLI\n```\n$ croak config [get|set|remove] \u003ckey\u003e [value] [-g]\n```\n\n### Programmatic API\n\nYou can use Croak as node.js module to integrate it in your application\n\n\u003e **Disclaimer**:\n\u003e Croak API can change radically in a near future.\n\u003e Retrocompatibility is not guaranteed for minor `0.x.x` beta releases\n\n#### Installation\n\nInstall Croak as local package\n```\n$ npm install croak [--save] [--save-dev]\n```\n\nThen require the module\n```js\nvar croak = require('croak')\n```\n\n#### Croak API\nThe `croak` module exposes the following members\n\n##### version\nCurrent Croak module version\n\n##### gruntVersion\nThe current Grunt version (which is using Croak)\n\n##### grunt\nExpose the Grunt module object. See [Grunt API][8] for more information\n\n##### config\nExposes the Croak [config](#croak-config-api) module API\n\n##### load([ configPath ])\nDiscover configuration files, then it will read, parse and load projects configuration\n\n##### loadProject([ configPath ])\nLoad config and returns the default configured project, it it exists\n\n##### get([ key ])\nAlias to [config#get](#configget-key-)\n\n##### set(key [, value, isLocalConfig])\nAlias to [config#set](#configsetkey--value-islocalconfig)\n\n##### init([ options, projectObj ])\nThis method will configure Croak with the passed options config object\nand aditionally you can pass the project config object\n(that you should get it previously via [croak.config.get()](#config-get--key-))\n\nAfter it, Croak will try to discover Croakfiles, and then configure and run Grunt\n\n##### initGrunt([ options ])\nConfigure Grunt with the passed options and run it\n\n#### Croak Config API\n\nThe Croak config object is exposed via the `croak` module\n\n```js\nvar config = require('croak').config\n```\n\n##### config.load([ filePath ])\nThis method tries to discover configuration files, then it will read, parse and load them\nIt will **throw an Error exception** if cannot read or parse configuration files\n\n##### config.save([ filePath ])\nSaves existing loaded configuration in disk\n\nIt will **throw an Error exception** if cannot write data\n\n##### config.raw()\nReturns an `object` with both global and local properties with\nthe config data as raw string (ini format)\n\n##### config.get([ key ])\nRetrieves an existing config value querying by its key. If not argument is passed, it will return the whole config\n\n```js\ncroakConfig.get('my-project') // { gruntfile: './path/to/Gruntfile.js' ... }\ncroakConfig.get('my-project.gruntfile') // './path/to/Gruntfile.js'\n```\n\n##### config.getDefault()\nReturns the default configured project config object. If it is not configured,\nit will return the first existing project, first by looking into local config, and then in the global one\n\n\n##### config.set(key [, value, isLocalConfig])\nSetter method for config values. You can set a new project, or a specific project config value with a primitive type\n\n```js\ncroakConfig.set('my-project', { gruntfile: '../Gruntile.js' })\ncroakConfig.set('my-project.gruntfile', '../new/path/to/Gruntile.js')\n```\n\n##### config.setLocal(key [, value])\n\n##### config.remove(key)\nRemoves a config value\n\n```js\ncroakConfig.remove('my-project') // removes the whole project\ncroakConfig.remove('my-project.gruntfile') // removes a specific key\n```\n\n##### config.value(key [, value, isLocalConfig])\nAlias accessor method for `set()` and `get()`\n\n```js\ncroakConfig.value('my-project') // I'm getting a value\ncroakConfig.value('my-project.gruntfile', '../Gruntfile.js') // I'm setting a value\n```\n\n##### config.globalFile()\nReturns the absolute path to the global configuration file in the system\n\n##### config.localFile([ filePath ])\nReturns the absolute path to the local configuration file\n\nCroak implements a simple algorithm like Grunt or NPM in order to discover the configuration\nfile in the current and in higher directories.\n\nOptionally, you can explicitly define a configuration path file to use passing the `filePath` argument\n\n##### config.clean()\nClean loaded config from cache. To apply it persistently in the disk, you must call it [config#save()](#save-filepath-)\n\n##### config.hasData()\nReturns `true` if the configuration was loaded and exists\n\n##### config.exists([ key ])\nCheck if a given property key exists in the current config\n\n```js\nconfig.exists('project') // true\nconfig.exists('nonexisting.gruntfile') // false\n```\n\n##### config.path()\nReturns an `object` with absolute paths to both global and local config files\n\n```js\nconfig.path()\n// { local: '/home/user/.croakrc', local: '/home/user/projects/awesome/.croakrc' }\n```\n\n##### config.dirname()\nThe same as config#path(), but this one only will return the absolute path directory\nwhere the config file is located\n\n\n## FAQ\n\n**Do I need to have Grunt already installed?**\n\nNo, Croak will do it for you. And also\n`grunt-cli` will be replaced by Croak CLI\n\n**Can I use the Grunt CLI?**\n\nOf course, it’s available using the `grunt` command\n\n```\n$ croak grunt --help\n```\n\n**Do I need to have a Gruntfile in my repository?**\n\nNo. An already existing Gruntfile is not required.\n\nYou only need to specify the global Gruntfile you want to use\nand, optionally, you can use a Croakfile to overwrite or extend global configuration\n\n**Can I use both Croak and Grunt at the same time?**\n\nYes. You must specify a global Gruntfile and also have your own repository Gruntfile.\n\nYou can run both like this:\n\n```\n$ croak run task -p project\n```\n```\n$ croak grunt localtask\n```\n\n## Development\n\nOnly node.js is required for development\n\n1. Clone/fork this repository\n```\n$ git clone git@github.com:adesisnetlife/croak.git \u0026\u0026 cd croak\n```\n\n2. Install package dependencies\n```\n$ npm install\n```\n\n3. Run tests\n```\n$ npm test\n```\n\n4. Coding zen mode\n```\n$ grunt dev [--force]\n```\n\n## Contributing\n\nCroak is completely written in LiveScript language.\nTake a look to the language [documentation][3] if you are new with it.\nPlease, follow the LiveScript language conventions defined in the [coding style guide][4]\n\nYou must add new test cases for any feature or refactor you do,\nalso keep in mind to follow the same design/code patterns that already exist\n\n## To Do/Wish list\n\n- Create an example use case project\n- Switch from promptly to inquirer (more featured and pretty CLI, like yeoman)\n- More test cases scenarios and destructive/evil testing\n- Croak API improvements: add callbacks and event listeners for a better Grunt execution control\n- Error CLI test cases\n- Better messages for the CLI and verbose mode\n- Better usage of the native grunt API (use grunt.option())\n- Simplified and better documentation (create a wiki?)\n- Support for multiple Gruntfile in the same project, or distributed Grunt tasks?\n- Support for Gruntfile instead of Croakfile? Rationale: easier to understand\n\nDo you miss something? Please, feel free to open an issue or make a PR!\n\n## Contributors\n\n- [Tomás Aparicio](https://github.com/h2non)\n\n## License\n\nCopyright (c) 2013 Adesis Netlife S.L and contributors\n\nReleased under the [MIT][5] license\n\n\n\n\n![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/AdesisNetlife/croak/trend.png)\n\n[1]: http://gruntjs.com\n[2]: https://github.com/h2non/grunt-croak\n[3]: http://livescript.net\n[4]: https://github.com/gkz/LiveScript-style-guide\n[5]: https://github.com/adesisnetlive/croak/blob/master/LICENSE\n[6]: https://gist.github.com/h2non/7787640\n[7]: http://nodejs.org\n[8]: http://gruntjs.com/api/grunt\n[9]: http://travis-ci.org/AdesisNetlife/croak\n[10]: https://gemnasium.com/AdesisNetlife/croak\n[11]: http://badge.fury.io/js/croak\n[12]: http://roadchange.com/AdesisNetlife/croak\n[13]: http://gruntjs.com/sample-gruntfile\n[14]: https://github.com/h2non/croak-grunt-faker\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAdesisNetlife%2Fcroak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAdesisNetlife%2Fcroak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAdesisNetlife%2Fcroak/lists"}