Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unslab

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unslab - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

4

index.js

@@ -7,3 +7,3 @@ const b4a = require('b4a')

function unslab (buf) {
const copy = b4a.alloc(buf.byteLength)
const copy = b4a.allocUnsafeSlow(buf.byteLength)
copy.set(buf, 0)

@@ -16,3 +16,3 @@ return copy

for (let i = 0; i < list.length; i++) size += list[i].byteLength
const copy = b4a.alloc(size)
const copy = b4a.allocUnsafeSlow(size)
const result = new Array(list.length)

@@ -19,0 +19,0 @@ let offset = 0

{
"name": "unslab",
"version": "0.0.0",
"version": "1.0.0",
"description": "Unslab some slab'ed buffers",
"main": "index.js",
"files": [
"index.js"
],
"dependencies": {

@@ -10,3 +13,4 @@ "b4a": "^1.6.6"

"devDependencies": {
"brittle": "^3.5.2"
"brittle": "^3.5.2",
"standard": "^17.1.0"
},

@@ -13,0 +17,0 @@ "scripts": {

@@ -1,7 +0,7 @@

# small-alloc
# unslab
WIP - nothing to see here
Unslab some slab'ed buffers
```
npm install small-alloc
npm install unslab
```

@@ -12,3 +12,9 @@

``` js
const small-alloc = require('small-alloc')
const unslab = require('unslab')
// the buf returned unpools the buffer passed from the memory slab
const buf = unslab(Buffer.from('hello world'))
// can do multiple at the same time if you use them together. only does a single alloc in this case
const [a, b] = unslab([Buffer.from('hello'), Buffer.from('world')])
```

@@ -18,2 +24,2 @@

MIT
Apache-2.0
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc