npm install gf-fixjsgf-fixjs is a library for encoding and decoding FIX protocol in pure JS.
Currently only tested on FIX5.0 & FIX5.0SP2.
Pls see below
var party = {};
party.PartyID = '010100000001';
party.PartyIDSource = '5';
party.PartyRole = '5';
order.Parties.push(party);
order.ExecID = '000001';
order.OrdStatus = 'N';
order.Instrument = {};
order.Instrument.SecurityID = '000776';
order.Instrument.SecurityIDSource = '102';
order.Side = '1';
order.OrderQtyData = {};
order.OrderQtyData.OrderQty = 20;
order.OrdType = '2';
order.Price=9.5;
order.TimeInForce = '0';
order.LastPx = '5.7';
order.LastQty = 10;
order.CumQty = 10;
order.LeavesQty = 10;
console.log("===================order======")
console.log(util.inspect(order, false, 6, false));
var str = fix.encode(order);
console.log("===================fix str======");
console.log(str);
Con't to encoding, just one code line
var order2 = fix.decode(str);
console.log("===================decode order======"
console.log(util.inspect(order2, false, 6, false));
npm install gf-fixjs
MIT.
See < http://git.gfcloud.com.cn/cheetah/toolbox/issues>.