Just download
https://chriseth.github.io/browser-solidity/soljson.js and use the following snippet to compile your contracts:
var soljson = require('./soljson.js');
var compileJSON = soljson.cwrap("compileJSON", "string", ["string", "number"]);
var input = "contract x { function g() {} }";
var output = JSON.parse(compileJSON(input, 1)); // 1 activates the optimiser
for (var contractName in output.contracts)
console.log(contractName + ': ' + output.contracts[contractName].bytecode);
Output also contains a lot of additional information.
Comments
soljson.js can be found at https://chriseth.github.io/browser-solidity/soljson.js
soljson.js.mem is nowhere to be found, but doesn't appear to be needed for the sample code above to work.