{"id":16007457,"url":"https://github.com/jonycheung/deadsimple-less-watch-compiler","last_synced_at":"2025-05-14T20:05:19.387Z","repository":{"id":4742731,"uuid":"5892161","full_name":"jonycheung/deadsimple-less-watch-compiler","owner":"jonycheung","description":"A nodejs script that allows you to watch a folder for changes and compile the less css files into another folder.","archived":false,"fork":false,"pushed_at":"2025-04-08T14:27:18.000Z","size":820,"stargazers_count":285,"open_issues_count":23,"forks_count":69,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-09T22:28:52.303Z","etag":null,"topics":["css-files","file-watchers","less-compiler","less-plugin","less-watcher","watch-compiler","watch-files"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/jonycheung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-09-20T19:58:09.000Z","updated_at":"2025-03-15T08:13:10.000Z","dependencies_parsed_at":"2024-01-11T19:18:13.941Z","dependency_job_id":"cad9bc21-d191-4efd-a8d0-f9b3b9f7c522","html_url":"https://github.com/jonycheung/deadsimple-less-watch-compiler","commit_stats":{"total_commits":282,"total_committers":28,"mean_commits":"10.071428571428571","dds":0.5390070921985816,"last_synced_commit":"2123d88b0b8946ba14f0758d221bb65272782849"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonycheung%2Fdeadsimple-less-watch-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonycheung%2Fdeadsimple-less-watch-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonycheung%2Fdeadsimple-less-watch-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonycheung%2Fdeadsimple-less-watch-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonycheung","download_url":"https://codeload.github.com/jonycheung/deadsimple-less-watch-compiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248553705,"owners_count":21123503,"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":["css-files","file-watchers","less-compiler","less-plugin","less-watcher","watch-compiler","watch-files"],"created_at":"2024-10-08T12:03:33.761Z","updated_at":"2025-04-13T14:06:17.831Z","avatar_url":"https://github.com/jonycheung.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/jonycheung/deadsimple-less-watch-compiler.svg?style=shield)](https://circleci.com/gh/jonycheung/deadsimple-less-watch-compiler) [![npm version](https://badge.fury.io/js/less-watch-compiler.svg)](https://badge.fury.io/js/less-watch-compiler) [![Dependencies](https://david-dm.org/jonycheung/deadsimple-less-watch-compiler.svg)](https://david-dm.org/jonycheung/less-watch-compiler) [![devDependency Status](https://david-dm.org/jonycheung/deadsimple-less-watch-compiler/dev-status.svg)](https://david-dm.org/jonycheung/less-watch-compiler#info=devDependencies) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![Backers on Open Collective](https://opencollective.com/less-watch-compiler/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/less-watch-compiler/sponsors/badge.svg)](#sponsors) \n\nDead Simple LESS CSS Watch Compiler\n===================\n\nA command that watches folders(and subfolders) for file changes and automatically compile the less css files into css. This is a file system watcher and compiler. It also keep track of a dependency tree and recompiles the parent if an imported (child) LESS file is changed.\n\nParts of this script is modified from Mikeal Rogers's watch script (https://github.com/mikeal/watch)\n\n\n## Prerequisites\n\u003eThe commands below may need to be prefixed with `sudo` depending upon your system\n\nInstall [LESS](http://www.lesscss.org/) and make sure the `lessc` binary is accessible to the script. Installing LESS with the `-g`(global) flag will make the binary accessible to your system.\n\n### [yarn](https://yarnpkg.com/) \n```bash\nyarn global add less\n```\n\n### [npm](https://www.npmjs.com/)\n```bash\nnpm install -g less\n```\n\n## Installation\n\u003eThe commands below may need to be prefixed with `sudo` depending upon your system\n\nInstall the `less-watch-compiler` command globally. \n\n### [yarn](https://yarnpkg.com/) \n```bash\nyarn global add less-watch-compiler\n```\n\n### [npm](https://www.npmjs.com/) \n```bash\nnpm install -g less-watch-compiler\n```\n\n## Usage\n### With no main file \nYou need to pass in the minimum 2 parameters - \u003csource_dir\u003e and \u003cdestination_dir\u003e . First parameter is the source folder to watch for changes and second is the output folder in which the css files will be compiled\n\nUsage: \n```bash\nless-watch-compiler [options] \u003csource_dir\u003e \u003cdestination_dir\u003e\n```\n\n### With main file\nIf you pass in the 3rd optional parameter, Any file change will trigger only to compile the main file specified in the 3rd parameter.\nAssuming the 3rd is \"main.less\" \n\nUsage: \n```bash\nless-watch-compiler [options] \u003csource_dir\u003e \u003cdestination_dir\u003e [main-file]\n```\n\n## Basic example\n```\t\t\n root \n └──src\n │    └── main.less\n │    └── aux.less\n └──dist\n      └── main.css\n```\n\nThe project can be compiled with the following command:\n```bash\nless-watch-compiler src dist main.less\n```\n\n## Configuration File\nBy default the the configuration file is loaded from ./less-watch-compiler.config.json but can also be specified by the --config \u003cfile\u003e option.\n\n#### Example using the project tree laid out in the previous example\n\nless-watch-compiler.config.json\n```json\n{\n    \"watchFolder\": \"src\",\n    \"outputFolder\": \"dist\",\n    \"mainFile\": \"main.less\"\n}\n```\nThe project can be compiled with the following command:\n```bash\nless-watch-compiler\n```\n\n## All configuration file options\n```json\n{\n    \"watchFolder\": \"\u003cinput_folder\u003e\",   \n    \"outputFolder\": \"\u003coutput_folder\u003e\",\n    \"mainFile\": \"\u003cmain-file\u003e\",   \n    \"includeHidden\": false,\n    \"sourceMap\": false,\n    \"plugins\": \"plugin1,plugin2\",\n    \"lessArgs\": \"option1=1,option2=2\",\n    \"runOnce\": false,\n    \"enableJs\": true\n}\n```\n\n## Options:\n\n    -h, --help                                                               output usage information\n    -V, --version                                                            output the version number\n    --main-file \u003cfile\u003e                                                       Specify \u003cfile\u003e as the file to always re-compile e.g. '--main-file style.less'.\n    --config \u003cfile\u003e                                                          Custom configuration file path. (default: \"less-watch-compiler.config.json\")\n    --run-once                                                               Run the compiler once without waiting for additional changes.\n    --include-hidden                                                         Don't ignore files beginning with a '.' or a '_'\n    --enable-js                                                              Less.js Option: To enable inline JavaScript in less files.\n    --source-map                                                             Less.js Option: To generate source map for css files.\n    --plugins \u003cplugin-a\u003e,\u003cplugin-b\u003e                                          Less.js Option: To specify plugins separated by commas.\n    --less-args \u003cless-arg1\u003e=\u003cless-arg1-value\u003e,\u003cless-arg1\u003e=\u003cless-arg2-value\u003e  Less.js Option: To specify any other less options e.g. '--less-args math=strict,strict-units=on,include-path=./dir1\\;./dir2'.\n\n## Please note:\n* By default, \"minified\" is turned on to always compress/minify output. You can set the minification to false by adding `\"minified\":false` in the config file.\n* By default, \"sourceMap\" is turned off. You can generating sourcemap to true by adding `\"sourceMap\":true` in the config file.\n* By default, this script only compiles files with `.less` extension. More file extensions can be added by modifying the `allowedExtensions` array in `config.json`.\n* Files that start with underscores `_style.css` or period `.style.css` are ignored. This behavior can be changed by adding `\"includeHidden:true` in the config file.\n* When `--run-once` used, compilation will fail on first error\n\n### Using the source files\nAlternativelly, you can checkout the code and run things locally like this:\n\n```bash\nnode less-watch-compiler.js [options]\n```\n\nTo run unit tests: `yarn test` or `npm test` (see test/test.js).\n\n\n## Contributors\n\nThis project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].\n\u003ca href=\"https://github.com/jonycheung/deadsimple-less-watch-compiler/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/less-watch-compiler/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonycheung%2Fdeadsimple-less-watch-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonycheung%2Fdeadsimple-less-watch-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonycheung%2Fdeadsimple-less-watch-compiler/lists"}