{"_id":"@csllc/ubx-parser","_rev":"9-5222a75967baa10098bf744d5166c906","name":"@csllc/ubx-parser","dist-tags":{"latest":"2.0.4"},"versions":{"2.0.0":{"name":"@csllc/ubx-parser","version":"2.0.0","keywords":["ublox","ubx","gps","gnss","parser","tcp","serialport"],"author":{"name":"Simon Gander"},"license":"ISC","_id":"@csllc/ubx-parser@2.0.0","maintainers":[{"name":"billglase","email":"bglase@controls.com"},{"name":"gfang","email":"gfang@controls.com"},{"name":"cwalden-cs","email":"cwalden@controls.com"}],"homepage":"https://github.com/bglase/ubx-parser#readme","bugs":{"url":"https://github.com/bglase/ubx-parser/issues"},"dist":{"shasum":"00df8eb6a02602ebfc4c67b6a2051b1aaf3996c1","tarball":"https://registry.npmjs.org/@csllc/ubx-parser/-/ubx-parser-2.0.0.tgz","fileCount":33,"integrity":"sha512-yqYDwNR+isECVHGQ5T4lKqHYjaDaVcoeZAs1dAOESzwJ7s9M7GfO2lgcCBXreAQLYVL71iU1BbbxjzmGGJyaiQ==","signatures":[{"sig":"MEUCIAfqKOCUkEtwS+DAjus9SFRf4Vd64zfwsX42YtxSshsCAiEAmIUdiwi2uJlEwgbTyUCafH+6ph2VYrzIikbZ5HgTvMw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64297},"main":"dist/cjs/index.js","types":"dist/types/index.d.js","module":"dist/esm/index.js","gitHead":"f378217f6d8d135a8fb6481ff6fe53f70f8d8c4f","scripts":{"build":"npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:types","build:cjs":"node tools/cleanup cjs && tsc -p config/tsconfig.cjs.json","build:esm":"node tools/cleanup esm && tsc -p config/tsconfig.esm.json","build:umd":"node tools/cleanup umd && webpack --config config/webpack.config.js","build:types":"node tools/cleanup types && tsc -p config/tsconfig.types.json"},"_npmUser":{"name":"billglase","email":"bglase@controls.com"},"umd:main":"dist/umd/index.js","repository":{"url":"git+https://github.com/bglase/ubx-parser.git","type":"git"},"_npmVersion":"10.2.3","description":"A parser for the GNSS protocol ubx. Developed and tested with a ublox M9L GPS module.","directories":{"lib":"lib"},"_nodeVersion":"18.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.75.0","ts-loader":"^9.4.2","typescript":"^4.9.4","@types/node":"^18.11.18","webpack-cli":"^5.0.1"},"_npmOperationalInternal":{"tmp":"tmp/ubx-parser_2.0.0_1715871652230_0.9862818664834425","host":"s3://npm-registry-packages"}},"2.0.1":{"name":"@csllc/ubx-parser","version":"2.0.1","keywords":["ublox","ubx","gps","gnss","parser","tcp","serialport"],"author":{"name":"Simon Gander"},"license":"ISC","_id":"@csllc/ubx-parser@2.0.1","maintainers":[{"name":"billglase","email":"bglase@controls.com"},{"name":"gfang","email":"gfang@controls.com"},{"name":"cwalden-cs","email":"cwalden@controls.com"}],"homepage":"https://github.com/bglase/ubx-parser#readme","bugs":{"url":"https://github.com/bglase/ubx-parser/issues"},"dist":{"shasum":"6539194c679db62bde18e051510213663e8f590e","tarball":"https://registry.npmjs.org/@csllc/ubx-parser/-/ubx-parser-2.0.1.tgz","fileCount":33,"integrity":"sha512-ktUR7BCIkFd9i9E6sb1XTA1Xa24t8mZsUDH9MHxWdnGd4IIfXfeNG1cwwaVoyQbHT9VmK7X9MWoL063RH+jf/Q==","signatures":[{"sig":"MEUCIBZB6pkNdVsmUk+ZL+LxfeC+PQKN2d7e+srwLZGhIUuWAiEAxkTiSRlbR63vJaeCfJbvtRXILi5qaM4QEPA7m1rcKuw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64666},"main":"dist/cjs/index.js","types":"dist/types/index.d.js","module":"dist/esm/index.js","gitHead":"9502cbfabeb729705a0389301ee34187b856b84a","scripts":{"build":"npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:types","build:cjs":"node tools/cleanup cjs && tsc -p config/tsconfig.cjs.json","build:esm":"node tools/cleanup esm && tsc -p config/tsconfig.esm.json","build:umd":"node tools/cleanup umd && webpack --config config/webpack.config.js","build:types":"node tools/cleanup types && tsc -p config/tsconfig.types.json"},"_npmUser":{"name":"billglase","email":"bglase@controls.com"},"umd:main":"dist/umd/index.js","repository":{"url":"git+https://github.com/bglase/ubx-parser.git","type":"git"},"_npmVersion":"10.2.3","description":"A parser for the GNSS protocol ubx. Developed and tested with a ublox M9L GPS module.","directories":{"lib":"lib"},"_nodeVersion":"18.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.75.0","ts-loader":"^9.4.2","typescript":"^4.9.4","@types/node":"^18.11.18","webpack-cli":"^5.0.1"},"_npmOperationalInternal":{"tmp":"tmp/ubx-parser_2.0.1_1715890381781_0.969232482067137","host":"s3://npm-registry-packages"}},"2.0.2":{"name":"@csllc/ubx-parser","version":"2.0.2","keywords":["ublox","ubx","gps","gnss","parser","tcp","serialport"],"author":{"name":"Simon Gander"},"license":"ISC","_id":"@csllc/ubx-parser@2.0.2","maintainers":[{"name":"billglase","email":"bglase@controls.com"},{"name":"gfang","email":"gfang@controls.com"},{"name":"cwalden-cs","email":"cwalden@controls.com"}],"homepage":"https://github.com/bglase/ubx-parser#readme","bugs":{"url":"https://github.com/bglase/ubx-parser/issues"},"dist":{"shasum":"f4b1c6dadb62787434b8e412a8f1518ffb5eefb2","tarball":"https://registry.npmjs.org/@csllc/ubx-parser/-/ubx-parser-2.0.2.tgz","fileCount":33,"integrity":"sha512-uOkNXuojq5PUfBGjAQ+HGPEUwn/uTc+DG5udn5tp2D3HMVJdEQzhW/qLuARmavvBkCGNwShTf20LghSafkmtAQ==","signatures":[{"sig":"MEUCIQCyvdTMHqDRQOX7nP6Zs8989unxz18x9SUv8Vq97gah0wIgdkHf65F0/oRHa8I2W5RdiLZpC8sV8Ql3Pb5aEJB51oo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64666},"main":"dist/cjs/index.js","types":"dist/types/index.d.js","module":"dist/esm/index.js","gitHead":"2f46066b24ac11d261e1736b7c2ec7b3b457bfe2","scripts":{"build":"npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:types","build:cjs":"node tools/cleanup cjs && tsc -p config/tsconfig.cjs.json","build:esm":"node tools/cleanup esm && tsc -p config/tsconfig.esm.json","build:umd":"node tools/cleanup umd && webpack --config config/webpack.config.js","build:types":"node tools/cleanup types && tsc -p config/tsconfig.types.json"},"_npmUser":{"name":"billglase","email":"bglase@controls.com"},"umd:main":"dist/umd/index.js","repository":{"url":"git+https://github.com/bglase/ubx-parser.git","type":"git"},"_npmVersion":"10.2.3","description":"A parser for the GNSS protocol ubx. Developed and tested with a ublox M9L GPS module.","directories":{"lib":"lib"},"_nodeVersion":"18.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.75.0","ts-loader":"^9.4.2","typescript":"^4.9.4","@types/node":"^18.11.18","webpack-cli":"^5.0.1"},"_npmOperationalInternal":{"tmp":"tmp/ubx-parser_2.0.2_1715890759569_0.5406686526406235","host":"s3://npm-registry-packages"}},"2.0.3":{"name":"@csllc/ubx-parser","version":"2.0.3","keywords":["ublox","ubx","gps","gnss","parser","tcp","serialport"],"author":{"name":"Simon Gander"},"license":"ISC","_id":"@csllc/ubx-parser@2.0.3","maintainers":[{"name":"billglase","email":"bglase@controls.com"},{"name":"gfang","email":"gfang@controls.com"},{"name":"cwalden-cs","email":"cwalden@controls.com"}],"homepage":"https://github.com/bglase/ubx-parser#readme","bugs":{"url":"https://github.com/bglase/ubx-parser/issues"},"dist":{"shasum":"7c9b7f29d7bfd92bffbb0189c81f50e075a4d566","tarball":"https://registry.npmjs.org/@csllc/ubx-parser/-/ubx-parser-2.0.3.tgz","fileCount":33,"integrity":"sha512-RxKytZRaW944D6rzK0ud6+w4G7hEB2FpRkLQRG2/E9A+AFDBcHDkcArE1HQ4BPiWHAV/ycTYnpsLKAVMWDxaDA==","signatures":[{"sig":"MEYCIQDLGRqoWP/UmWQxKq1aVj+GfiDQw4x2kXcUEwYlCE+9DAIhAK+w3msilRjidmih83/PHrw678jrrQ8ywrlwniVFv8TL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":70375},"main":"dist/cjs/index.js","types":"dist/types/index.d.js","module":"dist/esm/index.js","gitHead":"f976f6048950c7f1d52a3741299ed3b657324b1f","scripts":{"build":"npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:types","build:cjs":"node tools/cleanup cjs && tsc -p config/tsconfig.cjs.json","build:esm":"node tools/cleanup esm && tsc -p config/tsconfig.esm.json","build:umd":"node tools/cleanup umd && webpack --config config/webpack.config.js","build:types":"node tools/cleanup types && tsc -p config/tsconfig.types.json"},"_npmUser":{"name":"billglase","email":"bglase@controls.com"},"umd:main":"dist/umd/index.js","repository":{"url":"git+https://github.com/bglase/ubx-parser.git","type":"git"},"_npmVersion":"10.2.3","description":"A parser for the GNSS protocol ubx. Developed and tested with a ublox M9L GPS module.","directories":{"lib":"lib"},"_nodeVersion":"18.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.75.0","ts-loader":"^9.4.2","typescript":"^4.9.4","@types/node":"^18.11.18","webpack-cli":"^5.0.1"},"_npmOperationalInternal":{"tmp":"tmp/ubx-parser_2.0.3_1715890867246_0.23756663212836027","host":"s3://npm-registry-packages"}},"2.0.4":{"name":"@csllc/ubx-parser","version":"2.0.4","keywords":["ublox","ubx","gps","gnss","parser","tcp","serialport"],"author":{"name":"Simon Gander"},"license":"ISC","_id":"@csllc/ubx-parser@2.0.4","maintainers":[{"name":"sean.kudrna.cs","email":"skudrna@controls.com"},{"name":"billglase","email":"bglase@controls.com"},{"name":"gfang","email":"gfang@controls.com"},{"name":"cwalden-cs","email":"cwalden@controls.com"}],"homepage":"https://github.com/bglase/ubx-parser#readme","bugs":{"url":"https://github.com/bglase/ubx-parser/issues"},"dist":{"shasum":"6836cf0a2a139cb6107d1ef30f09984d4a300132","tarball":"https://registry.npmjs.org/@csllc/ubx-parser/-/ubx-parser-2.0.4.tgz","fileCount":33,"integrity":"sha512-iUrUKyQjDIxF5C2Uw+yBbufMEBwsmygGcA5bq60w56CSRzvCJHWipow1TfD605QUiVqShR3kRvMJDMevnt225w==","signatures":[{"sig":"MEUCIBu78OtZcCQhVCtOhUE6fQRpKGrZftx5Z3v3kdHR88zSAiEArwXn5qwmDxT37d2u5DKARRNQ6m6++iuxMrnjeT+binU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":70449},"main":"dist/cjs/index.js","types":"dist/types/index.d.js","module":"dist/esm/index.js","gitHead":"627fd54f86c2d12cbcbf439162a6596ab2c60a48","scripts":{"build":"npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:types","build:cjs":"node tools/cleanup cjs && tsc -p config/tsconfig.cjs.json","build:esm":"node tools/cleanup esm && tsc -p config/tsconfig.esm.json","build:umd":"node tools/cleanup umd && webpack --config config/webpack.config.js","build:types":"node tools/cleanup types && tsc -p config/tsconfig.types.json"},"_npmUser":{"name":"billglase","email":"bglase@controls.com"},"umd:main":"dist/umd/index.js","repository":{"url":"git+https://github.com/bglase/ubx-parser.git","type":"git"},"_npmVersion":"10.2.3","description":"A parser for the GNSS protocol ubx. Developed and tested with a ublox M9L GPS module.","directories":{"lib":"lib"},"_nodeVersion":"18.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"webpack":"^5.75.0","ts-loader":"^9.4.2","typescript":"^4.9.4","@types/node":"^18.11.18","webpack-cli":"^5.0.1"},"_npmOperationalInternal":{"tmp":"tmp/ubx-parser_2.0.4_1721614062996_0.9330129522175237","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-05-16T15:00:52.136Z","modified":"2026-03-18T18:52:28.344Z","2.0.0":"2024-05-16T15:00:52.491Z","2.0.1":"2024-05-16T20:13:01.945Z","2.0.2":"2024-05-16T20:19:19.759Z","2.0.3":"2024-05-16T20:21:07.382Z","2.0.4":"2024-07-22T02:07:43.138Z"},"bugs":{"url":"https://github.com/bglase/ubx-parser/issues"},"author":{"name":"Simon Gander"},"license":"ISC","homepage":"https://github.com/bglase/ubx-parser#readme","keywords":["ublox","ubx","gps","gnss","parser","tcp","serialport"],"repository":{"url":"git+https://github.com/bglase/ubx-parser.git","type":"git"},"description":"A parser for the GNSS protocol ubx. Developed and tested with a ublox M9L GPS module.","maintainers":[{"email":"gfang@controls.com","name":"gfang"},{"email":"cwalden@controls.com","name":"cwalden-cs"},{"email":"skudrna@controls.com","name":"sean.kudrna.cs"},{"email":"incuiti@icloud.com","name":"incuiti"},{"email":"dyaeger@controls.com","name":"dayaeger"}],"readme":"# UBX Parser\n\nA parser for the GNSS protocol ubx. Developed and tested with a ublox M9L GPS module.\n\n```\nnpm install @nextlvlup/ubx-parser\n```\n\nThis library was created based on the documentation provided by ublox.\n[Interface Description](https://content.u-blox.com/sites/default/files/documents/M9-ADR-5.15_InterfaceDescription_UBX-22037101.pdf)\n[Integration Manual](https://content.u-blox.com/sites/default/files/NEO-M9L_Integrationmanual_UBX-20048485.pdf)\n\n### Very basic usage example\n\n```ts\nimport { UBXParser } from \"@nextlvlup/ubx-parser\";\n\n// Create Parser Instance\nconst parser = new UBXParser();\n\n// Add Event Listener\nparser.on(\"warning\", (warning, buffer) => console.warn(warning));\nparser.on(\"error\", (error, buffer) => console.error(error));\nparser.on(\"data\", (data, buffer) => console.log(data));\n```\n\nthe `buffer` object contains the raw data packet.\n\n### Example over TCP/IP\n\nIf you want to provide the GNSS data from a local Linux device via TCP you can do this with the following command. `socat -d -d tcp-l:1234 file://dev/ttyS0,b460800,raw`\n\nThis command starts a TCP server and serves as a gateway between the local serial port ttyS0 and the TCP client.\n\n```ts\nimport { Socket } from \"net\";\nimport { UBXParser } from \"@nextlvlup/ubx-parser\";\n\nconst client = new Socket();\nconst parser = new UBXParser();\n\nclient.connect({ host: \"localhost\", port: 1234 }, () => console.log(\"connected\"));\n\n// Pass data to the parser\nclient.on(\"data\", (buffer) => parser.parse(buffer));\n// Receiving parsed data\nparser.on(\"data\", (data) => console.log(data));\n```\n\n### Example over SerialPort\n\n```ts\nimport { SerialPort } from \"serialport\";\nimport { UBXParser } from \"@nextlvlup/ubx-parser\";\n\nconst serialport = new SerialPort({ path: \"/dev/ttyS0\", baudRate: 460800 }, () => console.log(\"gps connected\"));\nconst parser = new UBXParser();\n\n// Pass data to the parser\nport.on(\"data\", (buffer) => parser.parse(buffer));\n// Receiving parsed data\nparser.on(\"data\", (data) => console.log(data));\n```\n\n### Data Object\n\nThe object returned in the data listener always contains a `packet_class` and a `packet_id`. These are used to identify what kind of packet it is. The remaining fields are packet-type dependent.\n\n| Field        | Type  | Example |\n| ------------ | ----- | ------- |\n| packet_class | uint8 | 0x01    |\n| packet_id    | uint8 | 0x07    |\n| ...          | ...   | ...     |\n\n### Create Custom Packet-Parser\n\nYou can also create your own packet parser if you need a packet that is not yet supported by this library.\n\n```ts\nimport { UBXParser, readBitFromUInt8, readBitFromUInt16, readBitFromUInt32 } from \"@nextlvlup/ubx-parser\";\n\nexport class CustomParser extends PacketParser {\n    constructor() {\n        // pass packet_class and packet_id for identification\n        super(0x01, 0x07);\n    }\n\n    parse(payload: Buffer): CustomData {\n        return {\n            // read uint32 starting at byte 0\n            iTOW: payload.readUInt32LE(0),\n            // read uint16 starting at byte 4\n            year: payload.readUInt16LE(4),\n            // read uint8 starting at byte 6\n            month: payload.readUInt8(6),\n            // read bit 0 from uint8 byte 7\n            validDate: readBitFromUInt8(payload.readUInt8(7), 0),\n            // read bit 0 from uint16 byte 8\n            invalidLlh: readBitFromUInt16(payload.readUInt16LE(8), 0),\n            // read bit 24 - 29 from uint32 byte 10\n            dataType: readBitFromUInt32(payload.readUInt32LE(10), 24, 6),\n        };\n    }\n}\n\nexport interface CustomData {\n    iTOW: number;\n    year: number;\n    month: number;\n    validDate: number;\n    invalidLlh: number;\n    dataType: number;\n}\n```\n\nThen the CustomParser can be registered in the UBXParser instance.\n\n```ts\nimport { UBXParser } from \"@nextlvlup/ubx-parser\";\nimport { CustomParser } from \"path/to/your/CustomParser\";\n\nconst parser = new UBXParser();\nparser.registerParser(new CustomParser());\n```\n","readmeFilename":"README.md"}