JavaScript.minify()

Minify a string of JavaScript code.

Usage

Hover over inputs/exits for more info.

var JavaScript = require('machinepack-javascript');


// Minify a string of JavaScript code.

JavaScript.minify({

javascript: 'var z = 123;\\nfunction abcz(a, b, c){\\nalert(a, b, c, z);}\\n',

}).execSync();

Inputs

javascript required

The Javascript code string to minify.

'var z = 123;\\nfunction abcz(a, b, c){\\nalert(a, b, c, z);}\\n'

Exits

error

An unexpected error occurred.

success

OK.

'function abcz(a,c,n){alert(a,c,n,z)}var z=123;'