1.0.0 • Published 7 years ago
fixparserjs v1.0.0
fixparserjs
fixparserjs
is a FIX Protocol parse module for Node.js.
When not specified the message fields are parsed using the "Start Of Header" character (ASCII 01) otherwise the user can specify the delimiter character to be used.
Supports FIX protocols 4.0 to 4.4.
Tested with node v6.9.5
Installation
$ npm install fixparserjs
Example of use
const fixparse = require('fixparserjs');
const fix42test_1 = "8=FIX.4.29=035=849=JWEK56=BNJM34=350=515757=585052=20150406-12:17:2711=d3e3f1b3-da8a-4310-884e-9abc3cc0980b37=acd163dd-232d-4bc5-9dcb-9f484a0462c341=1aa523a8-2533-4c96-97ac-f717b358773b109=71191076=71191017=b7969f8e-56d3-40c8-b2dc-75322b76ec1a20=039=21=JWEK84930046155=HCBK48=46428843022=154=238=8030040=159=032=8030031=48.14100030=O29=114=803006=280.9975=20150406-12:17:2760=20150406-12:17:27150=2151=0207=P10=0";
const fix42test_2 = "8=FIX.4.2^9=153^35=D^49=BLP^56=SCHB^34=1^50=30737^97=Y^52=20000809-20:20:50^11=90001008^1=10030003^21=2^55=TESTA^54=1^38=4000^40=2^59=0^44=30^47=I^60=20000809-18:20:32^10=061^";
const fix44test_2 = "8=FIX.4.4|9=244|35=s|34=5|49=sender|52=20060319-09:08:20.881|56=target|22=8|40=2|44=9|48=ABC|55=ABC|60=20060319-09:08:19|548=184214|549=2|550=0|552=2|54=1|38=9|453=2|448=8|447=D|452=4|448=AAA35777|447=D|452=3|54=2|38=9|453=2|448=8|447=D|452=4|448=aaa|447=D|452=3|10=100|8=FIX.4.4|9=244|35=s|34=5|49=sender|52=20060319-09:08:20.881|56=target|22=8|40=2|44=9|48=ABC|55=ABC|60=20060319-09:08:19|548=184214|549=2|550=0|552=2|54=1|38=9|453=2|448=8|447=D|452=4|448=AAA35777|447=D|452=3|54=2|38=9|453=2|448=8|447=D|452=4|448=aaa|447=D|452=3|10=100|8=FIX.4.4|9=244|35=s|34=5|49=sender|52=20060319-09:08:20.881|56=target|22=8|40=2|44=9|48=ABC|55=ABC|60=20060319-09:08:19|548=184214|549=2|550=0|552=2|54=1|38=9|453=2|448=8|447=D|452=4|448=AAA35777|447=D|452=3|54=2|38=9|453=2|448=8|447=D|452=4|448=aaa|447=D|452=3|10=100|8=FIX.4.4|9=244|35=s|34=5|49=sender|52=20060319-09:08:20.881|56=target|22=8|40=2|44=9|48=ABC|55=ABC|60=20060319-09:08:19|548=184214|549=2|550=0|552=2|54=1|38=9|453=2|448=8|447=D|452=4|448=AAA35777|447=D|452=3|54=2|38=9|453=2|448=8|447=D|452=4|448=aaa|447=D|452=3|10=100";
// Using the default "SOH" 'Start of Header' delimiter
console.log(fixparse.parse(fix42test_1));
// Using '^' character as delimiter
console.log(fixparse.parse(fix42test_2,'^'));
// Using '|' character as delimiter
console.log(fixparse.parse(fix44test_2,'|'));
License
1.0.0
7 years ago