{"id":22382399,"url":"https://github.com/jcoreio/sparkplug-payload","last_synced_at":"2025-08-22T22:04:01.842Z","repository":{"id":38174501,"uuid":"270845933","full_name":"jcoreio/sparkplug-payload","owner":"jcoreio","description":"routines for encoding and decoding sparkplug payloads","archived":false,"fork":false,"pushed_at":"2024-04-08T15:51:42.000Z","size":2251,"stargazers_count":6,"open_issues_count":11,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-16T13:09:42.205Z","etag":null,"topics":["mqtt","sparkplug","sparkplug-b","sparkplugb"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcoreio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-08T22:32:08.000Z","updated_at":"2024-04-22T16:21:29.000Z","dependencies_parsed_at":"2023-02-06T21:15:32.495Z","dependency_job_id":null,"html_url":"https://github.com/jcoreio/sparkplug-payload","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fsparkplug-payload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fsparkplug-payload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fsparkplug-payload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcoreio%2Fsparkplug-payload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcoreio","download_url":"https://codeload.github.com/jcoreio/sparkplug-payload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228209939,"owners_count":17885595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mqtt","sparkplug","sparkplug-b","sparkplugb"],"created_at":"2024-12-05T00:12:52.959Z","updated_at":"2024-12-05T00:12:53.048Z","avatar_url":"https://github.com/jcoreio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @jcoreio/sparkplug-payload\n\n[![CircleCI](https://circleci.com/gh/jcoreio/sparkplug-payload.svg?style=svg)](https://circleci.com/gh/jcoreio/sparkplug-payload)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![npm version](https://badge.fury.io/js/%40jcoreio%2Fsparkplug-payload.svg)](https://badge.fury.io/js/%40jcoreio%2Fsparkplug-payload)\n\nA library that provides tools for encoding and decoding payload objects using\nthe Sparkplug Google Protocol Buffer Schema described in the Sparkplug\nSpecification from Cirrus Link Solutions.\n\nhttps://s3.amazonaws.com/cirrus-link-com/Sparkplug+Topic+Namespace+and+State+ManagementV2.1+Apendix++Payload+B+format.pdf\n\n**Not a drop-in replacement for the original `sparkplug-payload` package; require paths have changed.**\n\n## Installation\n\n```sh\nnpm install --save @jcoreio/sparkplug-payload\n```\n\n### Encoding a payload\n\nHere is a code example of encoding a payload:\n\n```javascript\nvar sparkplug = require('@jcoreio/sparkplug-payload/spBv1.0'),\n  payload = {\n    timestamp: new Date().getTime(),\n    metrics: [\n      {\n        name: 'intMetric',\n        value: 1,\n        type: 'Int32',\n      },\n    ],\n  },\n  encoded = sparkplug.encodePayload(payload)\n```\n\n### Decoding a payload\n\nHere is a code example of decoding an encoded payload:\n\n```javascript\nvar decoded = sparkplug.decodePayload(encoded)\n```\n\n## License\n\nCopyright (c) 2017 Cirrus Link Solutions\n\nAll rights reserved. This program and the accompanying materials\nare made available under the terms of the Eclipse Public License v1.0\nwhich accompanies this distribution, and is available at\nhttp://www.eclipse.org/legal/epl-v10.html\n\nContributors: Cirrus Link Solutions, JCore Systems\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcoreio%2Fsparkplug-payload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcoreio%2Fsparkplug-payload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcoreio%2Fsparkplug-payload/lists"}