{"id":15674941,"url":"https://github.com/linusu/buffer-alloc-unsafe","last_synced_at":"2025-06-25T05:32:18.742Z","repository":{"id":57190936,"uuid":"66024266","full_name":"LinusU/buffer-alloc-unsafe","owner":"LinusU","description":"A ponyfill for Buffer.allocUnsafe","archived":false,"fork":false,"pushed_at":"2018-11-20T13:24:54.000Z","size":11,"stargazers_count":14,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T14:40:57.077Z","etag":null,"topics":[],"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/LinusU.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":"2016-08-18T19:18:16.000Z","updated_at":"2024-05-10T02:31:26.000Z","dependencies_parsed_at":"2022-08-30T11:32:08.975Z","dependency_job_id":null,"html_url":"https://github.com/LinusU/buffer-alloc-unsafe","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fbuffer-alloc-unsafe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fbuffer-alloc-unsafe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fbuffer-alloc-unsafe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinusU%2Fbuffer-alloc-unsafe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinusU","download_url":"https://codeload.github.com/LinusU/buffer-alloc-unsafe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249109628,"owners_count":21214183,"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-03T15:53:27.358Z","updated_at":"2025-04-15T16:37:59.686Z","avatar_url":"https://github.com/LinusU.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Buffer Alloc Unsafe\n\nA [ponyfill](https://ponyfill.com) for `Buffer.allocUnsafe`.\n\nWorks as Node.js: `v7.0.0` \u003cbr\u003e\nWorks on Node.js: `v0.10.0`\n\n## Installation\n\n```sh\nnpm install --save buffer-alloc-unsafe\n```\n\n## Usage\n\n```js\nconst allocUnsafe = require('buffer-alloc-unsafe')\n\nconsole.log(allocUnsafe(10))\n//=\u003e \u003cBuffer 78 0c 80 03 01 00 00 00 05 00\u003e\n\nconsole.log(allocUnsafe(10))\n//=\u003e \u003cBuffer 58 ed bf 5f ff 7f 00 00 01 00\u003e\n\nconsole.log(allocUnsafe(10))\n//=\u003e \u003cBuffer 50 0c 80 03 01 00 00 00 0a 00\u003e\n\nallocUnsafe(-10)\n//=\u003e RangeError: \"size\" argument must not be negative\n```\n\n## API\n\n### allocUnsafe(size)\n\n- `size` \u0026lt;Integer\u0026gt; The desired length of the new `Buffer`\n\nAllocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must be\nless than or equal to the value of `buffer.kMaxLength` and greater than or equal\nto zero. Otherwise, a `RangeError` is thrown.\n\n## See also\n\n- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc`\n- [buffer-fill](https://github.com/LinusU/buffer-fill) A ponyfill for `Buffer.fill`\n- [buffer-from](https://github.com/LinusU/buffer-from) A ponyfill for `Buffer.from`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Fbuffer-alloc-unsafe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinusu%2Fbuffer-alloc-unsafe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinusu%2Fbuffer-alloc-unsafe/lists"}