minify-dir

1.0.6 • Public • Published

Build Status License: MIT

minify-dir

Minify all the files under a directory.

Install

$ npm install -g minify-dir

Usage

usage : minify-dir I_FOLDER [output O_FOLDER]
 
Minify-Dir : Minify all the files under a directory.
 
positional arguments:
  I_FOLDER          Directory you want to minified.
 
optional arguments:
  O_FOLDER          Output all the minified files here.

CLI

Try minify a directory.

# Default Output => `website.min` 
$ minify-dir ./website
 
# Target Output => `website2` 
$ minify-dir ./website ./website2

Or you can minify file instead of a directory.

# Default Output => `website.min/anyfile.html` 
$ minify-dir ./website/anyfile.html
 
# Target Output => `website2/anyfile.html` 
$ minify-dir ./website/anyfile.html ./website2/anyfile.html

Example Code

Include minify-dir package in your code.

const minifyDir = require('minify-dir');

Minify all files under website directory recursively, defualt will output to website.min directory.

minifyDir.minifyDirectory([source], [option destination]);
 
/* Default Output => `website.min` */
minifyDir.minifyDirectory("./website");
 
/* Target Output => `website2` */
minifyDir.minifyDirectory("./website", "./website2");

Minify a CSS/HTML/JS file, default will output to website.min/anyfile.html.

minifyDir.minifyFile([source], [option destination]);
 
/* Default Output => `website.min/anyfile.html` */
minifyDir.minifyFile("./website/anyfile.html");
 
/* Target Output => `website2/anyfile.html` */
minifyDir.minifyFile("./website/anyfile.html", "./website2/anyfile.html");

Service Provider

Package Sidebar

Install

npm i minify-dir

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

14.6 kB

Total Files

6

Last publish

Collaborators

  • jayces