{"id":13760117,"url":"https://github.com/jDataView/jBinary","last_synced_at":"2025-05-10T10:31:27.455Z","repository":{"id":9239529,"uuid":"11059041","full_name":"jDataView/jBinary","owner":"jDataView","description":"High-level API for working with binary data.","archived":false,"fork":false,"pushed_at":"2022-12-08T00:41:25.000Z","size":2719,"stargazers_count":545,"open_issues_count":23,"forks_count":57,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-10T04:40:31.696Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"jdataview.github.io/jBinary/","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/jDataView.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-29T20:36:20.000Z","updated_at":"2025-03-14T17:17:35.000Z","dependencies_parsed_at":"2022-08-31T00:31:35.016Z","dependency_job_id":null,"html_url":"https://github.com/jDataView/jBinary","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jDataView%2FjBinary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jDataView%2FjBinary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jDataView%2FjBinary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jDataView%2FjBinary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jDataView","download_url":"https://codeload.github.com/jDataView/jBinary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253371118,"owners_count":21898004,"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":[],"created_at":"2024-08-03T13:01:03.579Z","updated_at":"2025-05-10T10:31:26.994Z","avatar_url":"https://github.com/jDataView.png","language":"JavaScript","readme":"[![Build Status](https://travis-ci.org/jDataView/jBinary.png?branch=master)](https://travis-ci.org/jDataView/jBinary) [![NPM version](https://badge.fury.io/js/jbinary.png)](https://npmjs.org/package/jbinary)\njBinary\n=======\n[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/jDataView/jBinary?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n## Binary data in JavaScript is easy!\n\n\u003cimg src=\"https://avatars1.githubusercontent.com/u/4702384?s=130\" align=\"right\"\u003e\u003c/img\u003e\n\njBinary makes it easy to create, load, parse, modify and save complex binary files and data structures in both browser and Node.js.\n\nIt works on top of [jDataView](https://github.com/jDataView/jDataView) ([DataView](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) polyfill with convenient extensions).\n\nWas inspired by [jParser](https://github.com/vjeux/jParser) and derived as new library with full set of operations for binary data.\n\n## How can I use it?\n\nTypical scenario:\n\n  * Describe [typeset](https://github.com/jDataView/jBinary/wiki/Typesets) with JavaScript-compatible declarative syntax (jBinary will do type caching for you).\n  * Create jBinary instance [from memory](https://github.com/jDataView/jBinary/wiki/jBinary-Constructor) or [from data source](https://github.com/jDataView/jBinary/wiki/Loading-and-saving-data) and your typeset.\n  * [Read/write](https://github.com/jDataView/jBinary/wiki/jBinary-Methods#readingwriting) data just as native JavaScript objects!\n\n## API Documentation.\n\nCheck out [wiki](https://github.com/jDataView/jBinary/wiki) for detailed API documentation.\n\n## Is there any example code?\n\nHow about TAR archive modification:\n```javascript\n// configuring paths for Require.js\n// (you can use CommonJS (Component, Node.js) or simple script tags as well)\nrequire.config({\n  paths: {\n    jdataview: 'https://jdataview.github.io/dist/jdataview',\n    jbinary: 'https://unpkg.com/jbinary@2.1.3/dist/browser/jbinary',\n    TAR: 'https://jdataview.github.io/jBinary.Repo/typeSets/tar' // TAR archive typeset\n  }\n});\n\nrequire(['jbinary', 'TAR'], function (jBinary, TAR) {\n  // loading TAR archive with given typeset\n  jBinary.load('sample.tar', TAR).then(function (jb/* : jBinary */) {\n    // read everything using type aliased in TAR['jBinary.all']\n    var files = jb.readAll();\n\n    // do something with files in TAR archive (like rename them to upper case)\n    files.forEach(function (file) {\n      file.name = file.name.toUpperCase();\n    });\n\n    jb.writeAll(files, 0); // writing entire content from files array\n    jb.saveAs('sample.new.tar'); // saving file under given name\n  });\n});\n```\n\n[Run](https://jsbin.com/jofipi/1/) or [edit](https://jsbin.com/jofipi/1/edit?js,console) it on JSBin.\n\n# Show me amazing use-cases!\n\nAdvanced demo that shows abilities and performance of jBinary - [Apple HTTP Live Streaming player](https://rreverser.github.io/mpegts/) which converts MPEG-TS video chunks from realtime stream to MP4 and plays them immediately one by one while converting few more chunks in background.\n\n[![Screenshot](https://rreverser.github.io/mpegts/screenshot.png?)](https://rreverser.github.io/mpegts/)\n\n---\n\nA [World of Warcraft Model Viewer](https://vjeux.github.io/jsWoWModelViewer/). It uses [jDataView](https://github.com/jDataView/jDataView)+[jBinary](https://github.com/jDataView/jBinary) to read the binary file and then WebGL to display it.\n\n[![Screenshot](https://vjeux.github.io/jsWoWModelViewer/images/modelviewer.png)](https://vjeux.github.io/jsWoWModelViewer/)\n---\n\nAlso check out [jBinary.Repo](https://jDataView.github.io/jBinary.Repo/) for advanced usage and demos of some popular file formats (and feel free to submit more!).\n\n# What license is it issued under?\n\nThis library is provided under [MIT license](https://raw.github.com/jDataView/jBinary/master/MIT-license.txt).\n","funding_links":[],"categories":["Files","Framework or Library","Files [🔝](#readme)","文件"],"sub_categories":["Runner","Parser","运行器","运行器e2e测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FjDataView%2FjBinary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FjDataView%2FjBinary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FjDataView%2FjBinary/lists"}