function serialize()

in nodejs/src/index.js [78:92]


function serialize (struct, noSettings, callback) {
	writeBytes(struct, callback, function (buffer, cb) {
		process.nextTick(function () {

      var bufferWithSettings;
      if (noSettings) {
          bufferWithSettings = buffer;
      } else {
          bufferWithSettings = Buffer.concat([Buffer.from([Compression.None]), buffer]);
      }

			cb(null, bufferWithSettings);
		});
	});
}