{"id":16834734,"url":"https://github.com/mscdex/buffy","last_synced_at":"2025-06-27T08:34:55.186Z","repository":{"id":66040812,"uuid":"1602484","full_name":"mscdex/buffy","owner":"mscdex","description":"Access and manipulate multiple node.js Buffers as if they were one continuous Buffer","archived":false,"fork":false,"pushed_at":"2011-04-17T17:24:45.000Z","size":100,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T04:36:10.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/mscdex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-04-12T04:12:18.000Z","updated_at":"2023-05-14T04:06:38.000Z","dependencies_parsed_at":"2023-02-19T21:35:14.051Z","dependency_job_id":null,"html_url":"https://github.com/mscdex/buffy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mscdex/buffy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fbuffy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fbuffy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fbuffy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fbuffy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mscdex","download_url":"https://codeload.github.com/mscdex/buffy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscdex%2Fbuffy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262223313,"owners_count":23277620,"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-10-13T12:07:39.739Z","updated_at":"2025-06-27T08:34:55.162Z","avatar_url":"https://github.com/mscdex.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Description\n===========\n\nBuffy is a utility module for [node.js](http://nodejs.org/) that lets you easily access and manipulate many Buffers as if they were one single Buffer.\n\n\nRequirements\n============\n\n* [node.js](http://nodejs.org/) -- v0.4.0 or newer\n\n\nExamples\n========\n\n    var Buffy = require('./buffy'), inspect = require('util').inspect;\n\n    var b = new Buffy();\n    b.append(new Buffer([1, 4, 3, 4, 1, 1, 4]));\n    b.append(new Buffer([20, 10, 12]));\n    b.append(new Buffer([6]));\n    b.append(new Buffer([44, 9]));\n\n    console.log(inspect(b));\n    // output: \u003cBuffy 01 04 03 04 01 01 04 14 0a 0c 06 2c 09\u003e\n\n    console.log(b.indexOf([1, 4]));\n    // output: 0\n\n    console.log(b.indexOf([1, 4], 1));\n    // output: 5\n\n    console.log(b.indexOf([1, 4, 20, 10, 12, 6]));\n    // output: 5\n    \n    console.log(b.indexOf([44, 9]));\n    // output: 11\n\n    var myBuffer = new Buffer(5);\n    b.copy(myBuffer, 0, 7, 12);\n    console.log(inspect(myBuffer));\n    // output: \u003cBuffer 14 0a 0c 06 2c\u003e\n\n\nAPI\n===\n\n_Properties_\n------------\n\n* **length** - Returns the total length of the contents of the Buffy\n\n\n_Methods_\n---------\n\n* **(constructor)**() - Creates and returns a new instance of a Buffy object.\n\n* **get**(Integer:index) - _Boolean/Integer:byte_ - Retrieves a single byte at the specified index. If the index is invalid, Boolean false is returned.\n\n* **set**(Integer:index, Integer:newByteValue) - _Boolean:success_ - Sets the byte at the specified index to the given value.\n\n* **indexOf**(Array:bytes, [Integer:start=0]) - _Integer:position_ - Searches for the specified bytes in the Buffy at an optional starting position. Returns -1 if the bytes were not found.\n\n* **copy**(Buffer:destBuffer, [Integer:destStart=0], [Integer:sourceStart=0], [Integer:sourceEnd=buffy.length]) - _(void)_ - Works similar to Buffer's copy().\n\n* **append**(Buffer:newBuffer) - _(void)_ - Appends the given Buffer to the end of the Buffy.\n\n* **GCBefore**(Integer:index) - _Integer:bytesRemoved_ - Removes any Buffers stored before the given Buffy index.\n\n* **toString**([String:encoding], [Integer:startIndex], [Integer:endIndex]) - _String:result_ - Decodes and returns a string with the specified encoding beginning at startIndex and ending at endIndex.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscdex%2Fbuffy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmscdex%2Fbuffy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscdex%2Fbuffy/lists"}