{"id":13701548,"url":"https://github.com/shootaroo/jit-grunt","last_synced_at":"2025-04-08T04:14:30.945Z","repository":{"id":12662442,"uuid":"15334289","full_name":"shootaroo/jit-grunt","owner":"shootaroo","description":"JIT(Just In Time) plugin loader for Grunt.","archived":false,"fork":false,"pushed_at":"2018-05-11T08:04:20.000Z","size":109,"stargazers_count":511,"open_issues_count":11,"forks_count":32,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-01T03:34:57.999Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shootaroo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-20T09:09:06.000Z","updated_at":"2025-02-01T09:59:32.000Z","dependencies_parsed_at":"2022-09-01T05:22:59.518Z","dependency_job_id":null,"html_url":"https://github.com/shootaroo/jit-grunt","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shootaroo%2Fjit-grunt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shootaroo%2Fjit-grunt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shootaroo%2Fjit-grunt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shootaroo%2Fjit-grunt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shootaroo","download_url":"https://codeload.github.com/shootaroo/jit-grunt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773719,"owners_count":20993639,"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-02T20:01:48.206Z","updated_at":"2025-04-08T04:14:30.929Z","avatar_url":"https://github.com/shootaroo.png","language":"JavaScript","readme":"# jit-grunt 0.10.0 [![NPM version](https://badge.fury.io/js/jit-grunt.png)](http://badge.fury.io/js/jit-grunt) [![Build Status](https://secure.travis-ci.org/shootaroo/jit-grunt.png?branch=master)](http://travis-ci.org/shootaroo/jit-grunt) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)\n\nA JIT(Just In Time) plugin loader for Grunt.  \nLoad time of Grunt does not slow down even if there are many plugins.\n\n\n### Before\n```js\ngrunt.loadNpmTasks('assemble');\ngrunt.loadNpmTasks('grunt-contrib-clean');\ngrunt.loadNpmTasks('grunt-contrib-connect');\ngrunt.loadNpmTasks('grunt-contrib-copy');\ngrunt.loadNpmTasks('grunt-contrib-csslint');\ngrunt.loadNpmTasks('grunt-contrib-less');\ngrunt.loadNpmTasks('grunt-contrib-jshint');\ngrunt.loadNpmTasks('grunt-contrib-uglify');\ngrunt.loadNpmTasks('grunt-contrib-watch');\ngrunt.loadNpmTasks('grunt-newer');\ngrunt.loadNpmTasks('grunt-wget');\n...\n```\n\n```\n$ grunt assemble\n...\nExecution Time (2014-01-14 02:52:59 UTC)\nloading tasks     5.7s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 84%\nassemble:compile  1.1s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 16%\nTotal 6.8s\n```\n\numm...\n\n\n### After\n```js\nrequire('jit-grunt')(grunt);\n```\n\n```\n$ grunt assemble\n...\nExecution Time (2014-01-14 02:53:34 UTC)\nloading tasks     111ms  ▇▇▇▇▇▇▇▇▇ 8%\nloading assemble  221ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 16%\nassemble:compile   1.1s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 77%\nTotal 1.4s\n```\n\nHave a pleasant Grunt life!\n\n\n## Install\n```\nnpm install jit-grunt --save-dev\n```\n\n\n## Usage\n\nRemoves `grunt.loadNpmTasks`, then add the `require('jit-grunt')(grunt)` instead. Only it.\n\n```js\nmodule.exports = function (grunt) {\n  require('jit-grunt')(grunt);\n\n  grunt.initConfig({\n    ...\n  });\n\n  grunt.registerTask('default', [...]);\n}\n```\nWill automatically search for the plugin from the task name.\nSearch in the following order:\n\n1. node_modules/grunt-contrib-`task-name`\n2. node_modules/grunt-`task-name`\n3. node_modules/`task-name`\n\n```\nclean           -\u003e node_modules/grunt-contrib-clean\nwget            -\u003e node_modules/grunt-wget\nmochaTest       -\u003e node_modules/grunt-mocha-test\nmocha_phantomjs -\u003e node_modules/grunt-mocha-phantomjs\nassemble        -\u003e node_modules/assemble\n```\n\n\n### Static mappings\nSecond parameter is static mappings.  \nIt is used when there is a plugin that can not be resolved in the automatic mapping.\n\n`taskname`: `grunt-plugin-name`\n\n```js\nrequire('jit-grunt')(grunt, {\n  sprite: 'grunt-spritesmith',\n  foo: '@abc/grunt-foo',        // for private modules.\n  bar: 'custom/bar.js'          // for custom tasks.\n});\n```\n\n\n### Options\n\n#### cwd\n\nType: `Strong`\nDefault: `process.cwd()`\n\nAll plugins and tasks are resolved relative to this path.\n\n#### pluginsRoot\n\nType: `String`  \nDefault: `'node_modules'`\n\nRoot directory of grunt plugins, relative to the working directory.\n\n```js\nrequire('jit-grunt')(grunt)({\n  pluginsRoot: 'other/dir'\n});\n```\n\n#### customTasksDir\n\nType: `String`  \nDefault: `null`\n\nJIT Loading for custom tasks dir (replacement of [grunt.loadTasks]), relative to the working directory..\n\n```js\nrequire('jit-grunt')(grunt)({\n  customTasksDir: 'custom/dir'\n});\n```\n\nSearch in the following order:\n\n1. `custom/dir`/`taskname`.js\n2. `custom/dir`/`taskname`.coffee\n\n#### loadTasks\n\nAlias to `customTasksDir`.\n\n\n## Example\n\nhttps://github.com/shootaroo/jit-grunt/tree/master/example\n\n\n## Release History\n\n- 2016-02-23  v0.10.0   Add option cwd.\n- 2015-02-02   v0.9.1   Support npm private modules.\n- 2014-10-15   v0.9.0   Support parent directories of node_modules.\n- 2014-08-07   v0.8.0   Support grunt.registerTask in plugin #19.\n- 2014-08-07   v0.7.1   Fix log output.\n- 2014-05-19   v0.7.0   Support custom task by CoffeeScript.\n- 2014-05-08   v0.6.0   Add option customTasksDir and pluginsRoot.\n- 2014-04-14   v0.5.0   Support static mappings for custom tasks.\n- 2014-04-14   v0.4.2   Fix loadTasks path.\n- 2014-04-09   v0.4.1   Revert path.resolve.\n- 2014-04-09   v0.4.0   Add loadTasks option.\n- 2014-03-17   v0.3.2   Fix grunt.loadTask bug.\n- 2014-03-17   v0.3.1   Fix grunt.loadTask bug.\n- 2014-03-17   v0.3.0   Support grunt.loadTasks.\n- 2014-02-27   v0.2.3   Support task name of camelCase and snake_case.\n- 2014-02-22   v0.2.2   Add plugin not found log.\n- 2014-01-23   v0.2.1   Change log to verbose.\n- 2014-01-13   v0.2.0   Load timing became JIT perfectly, and support time-grunt result.\n- 2013-12-24   v0.1.2   Log colored.\n- 2013-12-23   v0.1.1   Fix bug on grunt-contrib-concat.\n- 2013-12-21   v0.1.0   Support auto mappings.\n- 2013-12-20   v0.0.1   First release.\n\n\n## License\n\nThe MIT License (MIT)\n\nCopyright \u0026copy; 2013 [Shotaro Tsubouchi](https://github.com/shootaroo)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n\n[grunt.loadTasks]:http://gruntjs.com/api/grunt#grunt.loadtasks\n","funding_links":[],"categories":["JavaScript","others","Loaders"],"sub_categories":["Meetups"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshootaroo%2Fjit-grunt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshootaroo%2Fjit-grunt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshootaroo%2Fjit-grunt/lists"}