Ha valakinek parancssoros js un-minifier-re/de-minifier-re/beutifier-re volna szüksége:#!/bin/sh
if [ "$2" = "" ];
then
echo "Usage: beautify <source.min.js> <destination.js>"
exit 0
fi
if [ "`command -v nodejs`" = "" ];
then
echo "Please install nodejs."
exit 1
fi
BJS=`command -v beautify.js`
if [ "$BJS" = "" ];
then
echo "Please install beautify.js ('curl http://jsbeautifier.org/js/lib/beautify.js -o /usr/local/bin/beautify.js' or something...)"
exit 2
fi
SCRIPT=`mktemp -u "/tmp/beautify_run-XXXX" --suffix=".js"`
echo "var fs = require('fs');var beautify = require('""$BJS""');fs.readFile('""$1""', 'utf8', function (e, c){console.log(beautify.js_beautify(c));});" > $SCRIPT
nodejs "$SCRIPT" > "$2"
rm "$SCRIPT" |