{"_id":"@bitcomposer/notepack.io","_rev":"1-f63706a6704524f1b519555229035a03","name":"@bitcomposer/notepack.io","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bitcomposer/notepack.io","version":"1.0.0","description":"A fast Node.js implementation of the latest MessagePack spec forked from notepack.io","main":"lib/index.js","repository":{"type":"git","url":"git+https://github.com/bitcomposer/notepack.git"},"author":{"name":"Kenny Shepherd","email":"kshepherd@pcs-publishing.com"},"license":"MIT","bugs":{"url":"https://github.com/bitcomposer/notepack/issues"},"homepage":"https://github.com/bitcomposer/notepack","devDependencies":{"@msgpack/msgpack":"~1.12.0","benchmark":"^2.1.2","benchtable":"^0.1.0","chai":"^3.5.0","istanbul":"^0.4.5","jshint":"^2.9.5","mocha":"^3.2.0","msgpack-js":"^0.3.0","msgpack-lite":"^0.1.26","uglify-js":"^3.4.9"},"scripts":{"test":"npm run lint && istanbul cover _mocha -r test/support/env test/","build":"uglifyjs --compress --mangle --mangle-props keep_quoted -- dist/notepack.js > dist/notepack.min.js","lint":"jshint lib/*.js browser/*.js test/*.js"},"browser":{"./lib/encode.js":"./browser/encode.js","./lib/decode.js":"./browser/decode.js"},"dependencies":{"mongodb":"^3.6.4"},"gitHead":"3f82b0fa34b374fc362a9229d1417eefb0b6b745","_id":"@bitcomposer/notepack.io@1.0.0","_nodeVersion":"10.19.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-twlIA7i+IdvB1XOcu+Kt2kWVI8zGoMcVt5yaYSAiJXValip4zGUKKEjp0PWDcA/KF1yEQtMgJHE7/Ef7sPEPJg==","shasum":"274ea20ef1cf0f52f8e1e32fb73ee5ad270fdc2a","tarball":"https://registry.npmjs.org/@bitcomposer/notepack.io/-/notepack.io-1.0.0.tgz","fileCount":12,"unpackedSize":71044,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgI86xCRA9TVsSAnZWagAAvacP/1pmPdqTiV7fQVEa32hh\nAayl6eVSmJNE7zosX5tHP2UN4ddr51ie3b/9IkxDCWiWP/Q1RO5gZ8DDUjHp\nSv7/Bem4nvKwDGhnWdL1VvjubKSV/cpqV5g1P4rFgyKk5DtD8NEE1lf/RXgK\nKvFT/2j5nrAqft01eXID4VnI6BZW1v892RtK5NASBSwQ8bkOdjo6gM+IROt0\nYjaHQMbcMwbDxUhL2UuUcUqnA8GsnadQOn+oFpWwA3EydvIhv0w1J2nnwD8Q\nbxycHRtjEAi29OErdltDZ4KrzhA1Y95n/iD0JPJJv2MP4MmkL1+ay01gFSr7\nCbDkCFJuXJJ+X5sLca0EXNOeKx3Z2XnoG3fr81FlalscdyjmQVOPE54GonjS\ntSRwiZPTX7AgtOGVyzMDuRvCAvPVfA1mg1OXa0Hm6gguJXbMe+phmK9sn2zJ\ntRZnUDyfDEhY4qRuZvPxYB2YSLggpli3QTIxt3QX8PxVKJ3PqtF+9P7qfLZ1\nftVmeJn9mGKHx3031YtCcujlGaifn3xedKBy8GYjEyIFN5OHPtcvNgB+3uqy\ncfJHjSCrQKDYNG4QlsX6tA+3HfGt+4cSUqVQQU1Z2iWCUFbHpJjOf6xx68o9\neIdDveHJaaLiYcAvv9VSqE6ykjOj46Na7gln2h2aWidI8gv3+nkHBMaMD5nN\nAkkC\r\n=B7Bv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhhYkiiBd0X9vF0oLHwK1/ZU3ceL26u8zzo8EBr/WDkwIgdAQP7IYqnEcklAcfRt5riFxtVUC3PU/6zyFkfqO0KpM="}]},"_npmUser":{"name":"bitcomposer","email":"kshepherd@pcs-publishing.com"},"directories":{},"maintainers":[{"name":"bitcomposer","email":"kshepherd@pcs-publishing.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/notepack.io_1.0.0_1612959408700_0.8715396891524871"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-10T12:16:48.655Z","1.0.0":"2021-02-10T12:16:48.879Z","modified":"2022-04-04T18:59:47.339Z"},"maintainers":[{"name":"bitcomposer","email":"kshepherd@pcs-publishing.com"}],"description":"A fast Node.js implementation of the latest MessagePack spec forked from notepack.io","homepage":"https://github.com/bitcomposer/notepack","repository":{"type":"git","url":"git+https://github.com/bitcomposer/notepack.git"},"author":{"name":"Kenny Shepherd","email":"kshepherd@pcs-publishing.com"},"bugs":{"url":"https://github.com/bitcomposer/notepack/issues"},"license":"MIT","readme":"# notepack\r\n\r\n[![Build Status](https://travis-ci.org/bitcomposer/notepack.svg?branch=master)](https://travis-ci.org/bitcomposer/notepack)\r\n[![Coverage Status](https://coveralls.io/repos/github/bitcomposer/notepack/badge.svg?branch=master)](https://coveralls.io/github/bitcomposer/notepack?branch=master)\r\n\r\nA fast [Node.js](http://nodejs.org) implementation of the latest [MessagePack](http://msgpack.org) [spec](https://github.com/msgpack/msgpack/blob/master/spec.md).\r\nForked from [notepack.io](https://github.com/darrachequesne/notepack) as we need to be able to transport RegExp and mongo ObjectId's between our Moleculer microservices.\r\n\r\n## Notes\r\n\r\n- This implementation is not backwards compatible with those that use the older spec. It is recommended that this library is only used in isolated systems.\r\n- `undefined` is encoded as `fixext 1 [0, 0]`, i.e. `<Buffer d4 00 00>`\r\n- `Date` objects are encoded as `fixext 8 [0, ms]`, e.g. `new Date('2000-06-13T00:00:00.000Z')` => `<Buffer d7 00 00 00 00 df b7 62 9c 00>`\r\n- `ArrayBuffer` are encoded as `ext 8/16/32 [0, data]`, e.g. `Uint8Array.of(1, 2, 3, 4)` => `<Buffer c7 04 00 01 02 03 04>`\r\n- `ObjectId` are encoded as `string 8 [0, data]`, e.g. `new ObjectId('aaaaaaaaaaaaaaaaaaaaaaaa')` => `<Buffer e4 18 61 61 61 61 61 61 61 61 61 61 61 61>`\r\n- `RegExp` are encoded as `string 8 [0, data]`, e.g. `new RegExp('aaa')` => `<Buffer e4 05 2f 61 61 61 2f>`\r\n  or `string 16 [00, data]` => `<Buffer e5 01 02 2f ... 2f` (256 values in ...)\r\n\r\n## Install\r\n\r\n```\r\nnpm install @bitcomposer/notepack.io\r\n```\r\n\r\n## Usage\r\n\r\n```js\r\nvar notepack = require(\"@bitcomposer/notepack.io\");\r\n\r\nvar encoded = notepack.encode({ foo: \"bar\" }); // <Buffer 81 a3 66 6f 6f a3 62 61 72>\r\nvar decoded = notepack.decode(encoded); // { foo: 'bar' }\r\n```\r\n\r\n## Browser\r\n\r\nA browser version of notepack is also available (2.0 kB minified/gzipped)\r\n\r\nObjectId has not been included due to the heavy dependencies.\r\n\r\n```html\r\n<script src=\"https://unpkg.com/@bitcomposer/notepack.io@1.0.0/dist/notepack.min.js\"></script>\r\n<script>\r\n  console.log(notepack.decode(notepack.encode([1, \"2\", new Date()])));\r\n  // [1, \"2\", Thu Dec 08 2016 00:00:01 GMT+0100 (CET)]\r\n</script>\r\n```\r\n\r\n## Performance\r\n\r\nPerformance is currently comparable to msgpack-node (which presumably needs optimizing and suffers from JS-native overhead) and is significantly faster than other implementations. Several micro-optimizations are used to improve the performance of short string and Buffer operations.\r\n\r\nThe `./benchmarks/run` output on my machine is:\r\n\r\n```\r\n$ node -v\r\nv12.15.0\r\n$ ./benchmarks/run\r\nEncoding (this will take a while):\r\n+----------------------------+-------------------+-----------------+----------------+---------------+\r\n|                            │ tiny              │ small           │ medium         │ large         |\r\n+----------------------------+-------------------+-----------------+----------------+---------------+\r\n| notepack                   │ 2,187,481 ops/sec │ 510,581 ops/sec │ 39,187 ops/sec │ 231 ops/sec   |\r\n+----------------------------+-------------------+-----------------+----------------+---------------+\r\n| msgpack-js                 │ 111,209 ops/sec   │ 95,346 ops/sec  │ 9,896 ops/sec  │ 121 ops/sec   |\r\n+----------------------------+-------------------+-----------------+----------------+---------------+\r\n| msgpack-lite               │ 524,993 ops/sec   │ 195,466 ops/sec │ 18,269 ops/sec │ 242 ops/sec   |\r\n+----------------------------+-------------------+-----------------+----------------+---------------+\r\n| @msgpack/msgpack           │ 723,885 ops/sec   │ 292,447 ops/sec │ 30,438 ops/sec │ 80.26 ops/sec |\r\n+----------------------------+-------------------+-----------------+----------------+---------------+\r\n| JSON.stringify (to Buffer) │ 1,359,120 ops/sec │ 335,024 ops/sec │ 15,721 ops/sec │ 25.97 ops/sec |\r\n+----------------------------+-------------------+-----------------+----------------+---------------+\r\nDecoding (this will take a while):\r\n+--------------------------+-------------------+-----------------+----------------+---------------+\r\n|                          │ tiny              │ small           │ medium         │ large         |\r\n+--------------------------+-------------------+-----------------+----------------+---------------+\r\n| notepack                 │ 3,165,012 ops/sec │ 642,348 ops/sec │ 32,173 ops/sec │ 249 ops/sec   |\r\n+--------------------------+-------------------+-----------------+----------------+---------------+\r\n| msgpack-js               │ 1,255,151 ops/sec │ 280,944 ops/sec │ 24,396 ops/sec │ 243 ops/sec   |\r\n+--------------------------+-------------------+-----------------+----------------+---------------+\r\n| msgpack-lite             │ 667,059 ops/sec   │ 144,927 ops/sec │ 11,922 ops/sec │ 175 ops/sec   |\r\n+--------------------------+-------------------+-----------------+----------------+---------------+\r\n| @msgpack/msgpack         │ 1,760,026 ops/sec │ 353,698 ops/sec │ 18,816 ops/sec │ 45.68 ops/sec |\r\n+--------------------------+-------------------+-----------------+----------------+---------------+\r\n| JSON.parse (from Buffer) │ 1,750,845 ops/sec │ 407,212 ops/sec │ 24,999 ops/sec │ 35.77 ops/sec |\r\n+--------------------------+-------------------+-----------------+----------------+---------------+\r\n* Note that JSON is provided as an indicative comparison only\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md"}