Comparing version 0.0.0 to 1.0.0
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
24
12960
2
4
21