Minimize HTTP requests.
Inspired by Magipack.js, it concatenates any kind of files into a "pack" file coming with JSON file that specifies what files are packed, where they are in the pack bitwise and what type they are.
- node.js
npm install mm-packer
$ mm-packer -s files/original -o files/packed
-s, --source FILE Source directory
-o, --output FILE Output directory
-n, --name [STRING] Pack files name (Default is pack)
-k, --no-color Omit color from output
--debug Show debug information
-v, --version Display the current version
-h, --help Display help and usage details
const packer = require("mm-packer");
const packerOptions = {
source: "files/original",
output: "files/packed",
name: "pack" // Optional,
debug: true // Optional
};
packer(packerOptions);
If you've just downloaded the repository, run :
$ ./bin/mm-packer.js -s files/original -o files/packed
You should see the generated files in files/packed
.
You can check the pack can be correctly loaded and parsed with the demo in the folder unpacker
that uses mm-unpacker
.