{"name":"typedarray-pool","version":"1.2.0","description":"Reuse typed arrays","main":"pool.js","directories":{"test":"test"},"dependencies":{"bit-twiddle":"^1.0.0","dup":"^1.0.0"},"devDependencies":{"tape":"^2.12.3"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/typedarray-pool.git"},"keywords":["typed","array","cache","pool","memory","malloc","free","reuse","optimize","construct","overhead"],"author":{"name":"Mikola Lysenko"},"license":"MIT","gitHead":"d7a8a448caf51042e6c371b11074aab6ebaf53ad","testling":{"files":"test/*.js","browsers":["ie/10..latest","firefox/17..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/6.0..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"bugs":{"url":"https://github.com/mikolalysenko/typedarray-pool/issues"},"homepage":"https://github.com/mikolalysenko/typedarray-pool#readme","_id":"typedarray-pool@1.2.0","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-YTSQbzX43yvtpfRtIDAYygoYtgT+Rpjuxy9iOpczrjpXLgGoyG7aS5USJXV2d3nn8uHTeb9rXDvzS27zUg5KYQ==","shasum":"e7e90720144ba02b9ed660438af6f3aacfe33ac3","tarball":"http://registry-npm.ywwl.com/typedarray-pool/download/typedarray-pool-1.2.0.tgz","fileCount":6,"unpackedSize":15895,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeEV2QCRA9TVsSAnZWagAApx8P/jw2PG/FYlUzsqTSOQQt\nO+VVMo8kgyF+Fz8gnqodxC4Xt8un3poWYxuGxxFjphDi4PGIbafXYMzYyWYo\nGcAimnPOExIwszXGzaCNDuvS/8lC5h0pO1KqKqqyLS4TpzoZppExfPiN8LgB\nb6LRl+OVdwDgGartC69yk+yKxp6kGn/3E+ycIk2RAP5NfnTXu6DzxX2HqeDV\nO7ZHusAVdrnG5TSnzF7Xx98SGgUftKo2kFidIkKoArVuPXq4FBfMFsOqpcc1\nJXBjmjAEABpNms6MpIizOfN2OTqjhdEKnZrb7t3yhxk0+m0nFOu6k34A2Uuq\nRiKEpb2PHzMMXrfusBOyucDeF5Z83OYg5x1VTZ5/+u2LbkJk6yEC+IFy4+Vy\n6YDpcPBIR/Ug6XqQ2oI4/c7O2GLoTy7TbLEASmeW7OMXJkfoer2DjkaS9Otb\nPsCv+eD7aVRPGp88YLY2huT4vyrPNeZlKj9Zo8fsjPCUNyAY61XyxYoB8ocY\nhPctA6J3j+Ne8MeBIwXBybGhC8TPDJFyvlkGtFUVJoM6rOdRt6xbAV07Fewr\n8S0+t7uZ9c9ccpRwfEbDJXY58oU1SuDLQjRocV3acq9jhVmdpFZ3tynEpHU0\nTRMClj+sBne53pSf2mcgAvn/CM7Ix5QVWfBr7WpTI87dGXbxKjcgWMekE8GY\nA8yA\r\n=ewEI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvHbWU22lmcR38sGdMnDNEwsbuo3pDXzJzm9DSk2A10QIhAM83mR3FQPKSp3Gn9FC41lB/qUX7D+rN7gawKGLshUlC"}],"size":4147,"noattachment":false,"key":"/typedarray-pool/-/typedarray-pool-1.2.0.tgz"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typedarray-pool_1.2.0_1578196367696_0.8013095468274081"},"_hasShrinkwrap":false,"readme":"typedarray-pool\n===============\nA global pool for typed arrays.\n\n[![testling badge](https://ci.testling.com/mikolalysenko/typedarray-pool.png)](https://ci.testling.com/mikolalysenko/typedarray-pool)\n\n[![build status](https://secure.travis-ci.org/mikolalysenko/typedarray-pool.png)](http://travis-ci.org/mikolalysenko/typedarray-pool)\n\n# Example\n\n```javascript\nvar pool = require(\"typedarray-pool\")\n\n//Allocate a buffer with at least 128 floats\nvar f = pool.malloc(128, \"float\")\n\n// ... do stuff ...\n\n//When done, release buffer\npool.free(f)\n```\n\n# Install\n\n    npm install typedarray-pool\n\n# API\n\n```javascript\nvar pool = require(\"typedarray-pool\")\n```\n\n### `pool.malloc(n[, dtype])`\nAllocates a typed array (or ArrayBuffer) with at least n elements.\n\n* `n` is the number of elements in the array\n* `dtype` is the data type of the array to allocate.  Must be one of:\n\n  + `\"uint8\"`\n  + `\"uint16\"`\n  + `\"uint32\"`\n  + `\"int8\"`\n  + `\"int16\"`\n  + `\"int32\"`\n  + `\"float\"`\n  + `\"float32\"`\n  + `\"double\"`\n  + `\"float64\"`\n  + `\"arraybuffer\"`\n  + `\"data\"`\n  + `\"uint8_clamped\"`\n  + `\"bigint64\"`\n  + `\"biguint64\"`\n  + `\"buffer\"`\n\n**Returns** A typed array with at least `n` elements in it.  If `dtype` is undefined, an ArrayBuffer is returned.\n\n**Note**  You can avoid the dispatch by directly calling one of the following methods:\n\n* `pool.mallocUint8`\n* `pool.mallocUint16`\n* `pool.mallocUint32`\n* `pool.mallocInt8`\n* `pool.mallocInt16`\n* `pool.mallocInt32`\n* `pool.mallocFloat`\n* `pool.mallocDouble`\n* `pool.mallocArrayBuffer`\n* `pool.mallocDataView`\n* `pool.mallocUint8Clamped`\n* `pool.mallocBigInt64`\n* `pool.mallocBigUint64`\n* `pool.mallocBuffer`\n\n### `pool.free(array)`\nReturns the array back to the pool.\n\n* `array` The array object to return to the pool.\n\n**Note** You can speed up the method if you know the type of array before hand by calling one of the following:\n\n* `pool.freeUint8`\n* `pool.freeUint16`\n* `pool.freeUint32`\n* `pool.freeInt8`\n* `pool.freeInt16`\n* `pool.freeInt32`\n* `pool.freeFloat`\n* `pool.freeDouble`\n* `pool.freeArrayBuffer`\n* `pool.freeDataView`\n* `pool.freeUint8Clamped`\n* `pool.freeBigInt64`\n* `pool.freeBigUint64`\n* `pool.freeBuffer`\n\n### `pool.clearCache()`\nRemoves all references to cached arrays.  Use this when you are done with the pool to return all the cached memory to the garbage collector.\n\n# Credits\n(c) 2014 Mikola Lysenko. MIT License\n","publish_time":1578196367804,"_cnpm_publish_time":1578196367804,"dist-tags":{"latest":"1.2.0"}}