{"id":16831083,"url":"https://github.com/jpillora/compilejs","last_synced_at":"2025-06-27T15:07:02.217Z","repository":{"id":66133121,"uuid":"9285381","full_name":"jpillora/compilejs","owner":"jpillora","description":"A mini Grunt.js for the browser","archived":false,"fork":false,"pushed_at":"2015-11-01T03:54:30.000Z","size":320,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"gh-pages","last_synced_at":"2025-06-27T15:04:53.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","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/jpillora.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-04-08T00:10:25.000Z","updated_at":"2016-07-24T14:45:13.000Z","dependencies_parsed_at":"2023-02-19T23:15:39.487Z","dependency_job_id":null,"html_url":"https://github.com/jpillora/compilejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jpillora/compilejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpillora%2Fcompilejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpillora%2Fcompilejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpillora%2Fcompilejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpillora%2Fcompilejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpillora","download_url":"https://codeload.github.com/jpillora/compilejs/tar.gz/refs/heads/gh-pages","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpillora%2Fcompilejs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262279099,"owners_count":23286547,"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-13T11:42:09.838Z","updated_at":"2025-06-27T15:07:02.192Z","avatar_url":"https://github.com/jpillora.png","language":"CoffeeScript","readme":"Compile.js\n=========\n\n### Summary\n\nCompile.js is a GruntJS inspired JavaScript build tool for the browser.\nCompile.js makes it easy to create front end custom build widgets for your open-source projects.\n\n### Features\n\n* Fluent API\n* HTTP GET Files Cross-domain\n  * XHR for same origin\n  * Compile.js JSONP proxy server for cross origin\n* Trigger File Downloads\n  * Chromes a.download for instant\n  * Compile.js server POST replay for download for other browsers\n* Provided tasks\n* Auto-parallelisation\n\n### Download\n\nUse the [Compile.js API Explorer](http://jpillora.com/compilejs/builder/index.html) to compile your own build of Compile.js (very meta)\n\n### Usage\n\nMinify your library with [UglifyJS2](https://github.com/mishoo/UglifyJS2)\n\n``` javascript\n$.compile\n  .fetch('lib', 'js/my-lib.js')\n  .run('uglify', {\n    src: 'lib',\n    dest: 'lib-min'\n  })\n  .download('lib-min');\n```\n\n### Demos\n\n* [Minify example](http://jpillora.com/compilejs/example/uglify.html)\n* [Download example](http://jpillora.com/compilejs/example/download.html)\n* [CoffeeScript example](http://jpillora.com/compilejs/example/coffee.html)\n* [Concatenate example](http://jpillora.com/compilejs/example/concat.html)\n* [Popup example](http://jpillora.com/compilejs/example/popup.html)\n\n### API\n\n*Note: You can play with this API using the [Compile.js API Explorer](http://jpillora.com/compilejs/builder/index.html)*\n\n#### `$.compile`.`get( name[s], callback( err, value[s] ) )`\n\nGet a value\n\n* `name[s]` - string or an array of strings\n\n* `value[s]` - same type as `name[s]`\n\n#### `$.compile`.`set( name, value )`\n\nSet a value.\n\n* `name` - string\n* `value` - string\n\n#### `$.compile`.`fetch( name, url )`\n\nFetches a URL and \n\n* `name` - string\n* `url` - string\n\n*Note: `url` will be retrieved with an XHR request if it has the same origin as the current page, otherwise it will be retrieved using the Compile.js JSONP proxy server*\n\n#### `$.compile`.`run( taskName, taskConfig )`\n\nRuns the given task with the given config\n\n* `taskName` - string\n* `taskConfig` - object\n\n#### `$.compile`.`download( name )`\n\nDownloads the value of `name` as `filename`\n\n* `name` - string\n* `filename` - string [optional] - defaults to \"`name`.js\"\n\n*Note: On browsers that do not support [anchor download attribute](http://caniuse.com/download), the download\nwill be forced by POSTing the contents of the file to the Compile.js POST replay server which\nwill just return the content though with the `Content-Disposition` header set.*\n\n#### `$.compile`.`popup( name )`\n\nOpen a small popup with the value of `name`\n\n* `name` - string\n\n*Warning: This will likely trigger a popup warning from most modern browsers*\n\n#### `$.compile`.`log( callback ( string ) )`\n#### `$.compile`.`error( callback ( string ) )`\n#### `$.compile`.`warn( callback ( string ) )`\n\nLog, Error and Warning handlers\n\n### Tasks\n\n#### `$.compile`.`task( taskName, definition )`\n\nAdds a new task\n\nIf `definition` is:\n\n* a string, it will be treated as a script URL and attempt to load it.\n* a function, it must have the signature `function(config, callback)`\n  * `config` will contain the object the user provides\n      * `config.src` *Note: the `src` property will be passed through `instance`.`get()` and\n         when this function is executed, `config.src` will be the the `value[s]`\n         associated with the `name[s]`*\n  * `callback` must be called when the task is complete\n\n* If `definition` is a object, it must contain a:\n  * `run` function - which matches the signature above\n\n  and optional:\n\n  * `fetch` object - which map global names to URLs, missing globals will be fetched. *Useful for lazy loading dependancies.*\n  * `init` function - which will run once all URLs have been fetched.\n\n#### [Task list](https://github.com/jpillora/compilejs/tree/gh-pages/dist/tasks)\n\n* Concat - [Built-in](https://github.com/jpillora/compilejs/blob/gh-pages/src/compile.coffee#L236)\n* CoffeeScript - [compile.coffee-script.js](https://github.com/jpillora/compilejs/tree/gh-pages/dist/tasks/compile.coffee-script.js)\n* Uglify - [compile.uglify.js](https://github.com/jpillora/compilejs/tree/gh-pages/dist/tasks/compile.coffee-script.js)\n* *More to come...*\n\nUsing the [Compile.js API Explorer](http://jpillora.com/compilejs/builder/index.html), you can build a custom version of Compile.js which includes a subset of these tasks.\n\n#### Conceptual Overview\n\nThis library uses method chaining. There is no \"create\" method because a static verions of each chainable method is made which adds an extra step - creates an instance - then the corresponding instance method is called (Code is [here](https://github.com/jpillora/compilejs/blob/gh-pages/src/compile.coffee#L242)). Each instance has an event emitter. When you `get()`, an event listener will watch for the `name` to be set. When you `set()`, an event will be fired - triggering all listeners. This way, the order of operations will work itself out.\n\n#### MIT License\n\nCopyright © 2013 Jaime Pillora \u0026lt;dev@jpillora.com\u0026gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpillora%2Fcompilejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpillora%2Fcompilejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpillora%2Fcompilejs/lists"}