{"id":16625752,"url":"https://github.com/aleclarson/grunt-then","last_synced_at":"2025-09-16T04:32:03.816Z","repository":{"id":28435872,"uuid":"31950935","full_name":"aleclarson/grunt-then","owner":"aleclarson","description":"Anonymous tasks and targets in Grunt.","archived":false,"fork":false,"pushed_at":"2018-12-05T14:34:30.000Z","size":10,"stargazers_count":13,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-01T22:24:37.030Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","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/aleclarson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-10T10:16:29.000Z","updated_at":"2021-09-09T12:18:02.000Z","dependencies_parsed_at":"2022-08-31T09:02:02.342Z","dependency_job_id":null,"html_url":"https://github.com/aleclarson/grunt-then","commit_stats":null,"previous_names":["aleclarson/grunt-anon-tasks"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fgrunt-then","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fgrunt-then/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fgrunt-then/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fgrunt-then/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleclarson","download_url":"https://codeload.github.com/aleclarson/grunt-then/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233203264,"owners_count":18640817,"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-10-12T04:07:06.532Z","updated_at":"2025-09-16T04:32:03.398Z","avatar_url":"https://github.com/aleclarson.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# grunt-then v1.0.0\n\nSchedule a `Function` to be called without ever registering it via `grunt.registerTask`. This is called an **anonymous task**.\n\n```JavaScript\ngrunt\n  .run(\"coffee\")\n  .then(function () {\n    console.log(this.name)\n  })\n```\n\nAs seen above, the `this` context in anonymous tasks is [just like in normal tasks](http://gruntjs.com/api/inside-tasks).\n\n-\n\nPlus, you can fail an anonymous task early (just like in normal tasks).\n\n```JavaScript\ngrunt.task\n  .then(function () {\n    return false // synchronous failure\n  })\n  .then(function () {\n    var done = this.async()\n    performAsyncOperation(function () {\n      done(false) // asynchronous failure\n    })\n  })\n```\n\n-\n\nDebugging is easier when an anonymous task has a description. Of course, this is optional.\n\n```Javascript\ngrunt.task.then(\"A description of what I'm doing\", function () {\n  // do cool grunty things\n})\n```\n\nIf the `--verbose` flag is used and a description is provided, it will be printed when the anonymous task starts.\n\n-\n\nSchedule an existing task to be called with a single-use configuration. This is called an **anonymous target**.\n\n```JavaScript\ngrunt.then(\"clean\", {\n  // Calls the 'clean' task with temporary configuration (after the previous task completes).\n})\n```\n\ninstall\n-------\n\n```sh\nnpm install --save-dev grunt-then\n```\n\nIn your Gruntfile:\n\n```Javascript\ngrunt.loadNpmTasks(\"grunt-then\")\n```\n\nUse [`load-grunt-tasks`](https://github.com/sindresorhus/load-grunt-tasks) when you have more than one NPM task to load.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Fgrunt-then","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleclarson%2Fgrunt-then","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Fgrunt-then/lists"}