{"id":14984821,"url":"https://github.com/snigbhaumik/node-minify-all","last_synced_at":"2026-03-14T03:31:35.138Z","repository":{"id":75572977,"uuid":"94434206","full_name":"SnigBhaumik/node-minify-all","owner":"SnigBhaumik","description":"Minifies CSS, JavaScripts and Images under the current directory tree","archived":false,"fork":false,"pushed_at":"2017-06-19T10:02:28.000Z","size":12,"stargazers_count":1,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-27T07:46:26.572Z","etag":null,"topics":["css-minifier","gulp","jenkins","jenkins-build","jenkins-pipeline","js-minifier","liferay","liferay-portal","minifies-css","node-minify"],"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/SnigBhaumik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2017-06-15T11:47:35.000Z","updated_at":"2017-08-03T12:07:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"070323ee-1690-46eb-a5f5-a477850ea0ac","html_url":"https://github.com/SnigBhaumik/node-minify-all","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"f7ef0e1c55ceac66e33ee2201dfe2d9773df4457"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnigBhaumik%2Fnode-minify-all","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnigBhaumik%2Fnode-minify-all/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnigBhaumik%2Fnode-minify-all/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnigBhaumik%2Fnode-minify-all/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SnigBhaumik","download_url":"https://codeload.github.com/SnigBhaumik/node-minify-all/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnigBhaumik%2Fnode-minify-all/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259176069,"owners_count":22817111,"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-minifier","gulp","jenkins","jenkins-build","jenkins-pipeline","js-minifier","liferay","liferay-portal","minifies-css","node-minify"],"created_at":"2024-09-24T14:09:43.114Z","updated_at":"2026-03-14T03:31:35.101Z","avatar_url":"https://github.com/SnigBhaumik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-minify-all\nMinifies CSS, JavaScripts and Images under the current directory tree with gulp task wrapper.\n\n\n# What's new?\n- Of course, lots of image, js, css minifiers are available around. The difference is here we can write individual business rules per file (for example, in case you don't want a particular file not to be minified).\n- You can run individual tasks or all the tasks or any combination of these.\n- We had this requirement of minifying and compressing artefacts before theme and portlet build in Liferay. Since somehow Liferay does not automatically minify all these files before compiling and building, we had to manually trigger the minification process prior to build. This module is used in that build process by Jenkins job and pipeline.\n\n\n# Usage\n\n## Using gulp\nYou can pass two command line arguments (both optional).\n- rootpath: name of the folder under current directory, where the process should execute. Default `docroot`.\n- backups: boolean value to determine whether backup copy should be created while minifying. Default `false`.\n\nFour gulp tasks are defined.\n```sh\n$ gulp minify-css --rootpath myfolder\nMinifies all the CSS files under the directory (files with .css extension).\n```\n```sh\n$ gulp minify-js --backups true\nMinifies all the JavaScript files under the directory (files with .js extension).\n```\n```sh\n$ gulp minify-img --rootpath=myfolder --backups=true\nMinifies all the image files under the directory (files with .jpg and .png extension).\n```\n```sh\n$ gulp \nRuns all the above three tasks, minifiying all images, CSS and JS files.\n```\n\n## Using node cli\nYou can pass three command line arguments (all optional).\n- rootpath: name of the folder under current directory, where the process should execute. Default `docroot`.\n- mode: what should be minified. Options are `css`, `js`, `img`, `all`. Default `all`.\n- backups: boolean value to determine whether backup copy should be created while minifying. Default `false`.\n```sh\n$ node index --rootpath=myfolder --mode=css\nMinifies all the CSS files under the directory (files with .css extension).\n```\n```sh\n$ node index --rootpath myfolder --mode js --backups true\nMinifies all the JavaScript files under the directory (files with .js extension).\n```\n```sh\n$ node index --rootpath=myfolder --mode=img --backups=true\nMinifies all the image files under the directory (files with .jpg and .png extension).\n```\n```sh\n$ node index --rootpath myfolder --backups true\nRuns all the above three tasks, minifiying all images, CSS and JS files.\n```\n\n\n## API\nUse the `minify-all-api` for this.\n```js\nvar minify = require('node-minify-all/minify-all-api');\n\nvar opts = {\n\trootpath: 'myfolder',\n\tmode: 'all',\n\tbackups: false\n};\n\nminify.process(opts);\n```\n\n\n# Dependencies\n- [gulp](https://www.npmjs.com/package/gulp)\n- [imagemin](https://www.npmjs.com/package/imagemin)\n- [node-minify](https://www.npmjs.com/package/node-minify)\n- [fs-extra](https://www.npmjs.com/package/fs-extra)\n- [yargs](https://www.npmjs.com/package/yargs)\n\n\n# License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnigbhaumik%2Fnode-minify-all","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnigbhaumik%2Fnode-minify-all","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnigbhaumik%2Fnode-minify-all/lists"}