1.0.6 • Published 6 years ago

minify-dir v1.0.6

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

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