{"_id":"struct","_rev":"31-3744fd4b165e804fb5917a9cacbc50b7","name":"struct","description":"Pack/Unpack multibyte binary values from/to buffers ","dist-tags":{"latest":"0.0.12"},"versions":{"0.0.1":{"name":"struct","version":"0.0.1","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{"node-proxy":">=0.5.1"},"repositories":[{"type":"git","url":"http://github.com/xdenser/node-struct.git"}],"engines":{"node":">0.4.0"},"_npmJsonOpts":{"file":"/root/.npm/struct/0.0.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"struct@0.0.1","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"2087c58ea4623377549f9e416ada67615ea42996","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.1.tgz","integrity":"sha512-0qrFdnQ9B1zK0DgLtAWAs74uHhpsYnAaN6CiyVXuyEv4LjL6XwLmV/DDoSFAVBv0OMgY6Zt/mme8joRpSURuXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDm25mfStv7qgk8Z3bFNlYuJlMMoifxvn96qFgRCwZACQIgC2piaVjjuCYwlsQM8ifpZG/DbaxzZ1i0yPElqT+9k/k="}]},"directories":{}},"0.0.2":{"name":"struct","version":"0.0.2","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{"node-proxy":">=0.5.1"},"repositories":[{"type":"git","url":"http://github.com/xdenser/node-struct.git"}],"engines":{"node":">0.4.0"},"_npmUser":{"name":"xdenser","email":"xdenser@gmail.com"},"_id":"struct@0.0.2","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"3b2ce13ef3adb7af2cfce732b74370139a78454e","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.2.tgz","integrity":"sha512-qTph12ojR24Jt5XQGu8iTyCXPZL5R6e+N2gQV5aDAvDkvkyEx30W5wRcRjpnBm16eDNvLDy5MD2aj9uw6qtXNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFJc845lJys5QiPlHN7LgF76JQ0PizhTpVN0tYkfSxBXAiEAnzBmsDSwxJrGxt02aAarjjxRgKoeSzt7FXg+HqAezbk="}]},"directories":{}},"0.0.3":{"name":"struct","version":"0.0.3","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{"node-proxy":">=0.5.1"},"repositories":[{"type":"git","url":"http://github.com/xdenser/node-struct.git"}],"engines":{"node":">0.4.0"},"_npmUser":{"name":"xdenser","email":"xdenser@gmail.com"},"_id":"struct@0.0.3","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"5d2c348ea5bcca851503d862300a709121f393be","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.3.tgz","integrity":"sha512-oMkETsc1MMqdTBjpNcoipDTmZXrNF/BZ1FF1SJaurSl69KE0hplXZ8+wloI3bgCloPeJdYcQBCXvpFfSyLbgaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNowYs8UUFopzhihnHXkBb3xrcl4oJRALlt7c3+lkWDwIgE2sib01TZ+bebkOoxx914oMV9PjmAQDgGCHvz0wiO7k="}]}},"0.0.4":{"name":"struct","version":"0.0.4","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{"node-proxy":">=0.5.1"},"repositories":[{"type":"git","url":"http://github.com/xdenser/node-struct.git"}],"engines":{"node":">0.4.0"},"_npmUser":{"name":"xdenser","email":"xdenser@gmail.com"},"_id":"struct@0.0.4","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"a712cf7296a60df804ce27c5ddf741f2620b973d","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.4.tgz","integrity":"sha512-JJ9d1+eezpW49TXL0LFwv/LLsuQRqUSgeGW0s9e0HuKS+VRXFeC07o54sylqXzlgcMH+OXMcIGu26D/RYOlZzg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjFitylWGlRxIyiggUKgnVt9S06DaxWo1rjEc+NIj83AIhAMssR+OShM9Wdw8rScNtrVCkRL1WCHI81JlOJYL2AW8P"}]}},"0.0.5":{"name":"struct","version":"0.0.5","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{},"repositories":[{"type":"git","url":"http://github.com/xdenser/node-struct.git"}],"engines":{"node":">0.6.0"},"_npmUser":{"name":"xdenser","email":"xdenser@gmail.com"},"_id":"struct@0.0.5","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"e41f587d31ce32cc7c9032b721b4679a85fcf2df","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.5.tgz","integrity":"sha512-aS2QrmAxwlVSNDCXr+acHdJifJ95I7Qj7xLG3PEunqSqIW5a4IKuQXQJoZPKWjGvasYz8pyGARnngtpgoyusig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGiW6Aw7cj+z3K/9YWdBoUZMDWxfdc+s8z/6U4UuzR2iAiB4EnW/g5cZ7RTNW9C799q4FQon+X1PXr8hNevEj4dhLQ=="}]}},"0.0.6":{"name":"struct","version":"0.0.6","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{},"repositories":[{"type":"git","url":"http://github.com/xdenser/node-struct.git"}],"engines":{"node":">0.6.0"},"_npmUser":{"name":"xdenser","email":"xdenser@gmail.com"},"_id":"struct@0.0.6","devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"ca0fdbc9f11103b9358026e8c2642a325336f0fa","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.6.tgz","integrity":"sha512-+aOpFLboGhTVohxzsSZ2HlifX1appNn0WHzMpVe+p3LcBH5FtqjKP5xBk+dybIVFgOC1kuQnFrptLirIFue6bg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYQunKHr7fDvC1BhB1Y8rar0fS1bZejse/g+Ad1IVvTAiEAnYDLqgtSfyzTUkoaBOG1tXt1dMQ72wXFLR1Dk5TZGN8="}]}},"0.0.7":{"name":"struct","version":"0.0.7","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{},"repositories":[{"type":"git","url":"http://github.com/xdenser/node-struct.git"}],"engines":{"node":">0.6.0"},"gitHead":"ae69fa7069d56ed302ae68b456bbd5a40f7af559","repository":{"type":"git","url":"http://github.com/xdenser/node-struct.git"},"homepage":"https://github.com/xdenser/node-struct","_id":"struct@0.0.7","scripts":{},"_shasum":"cecd591956a741a504b735f90b768e21827a9f71","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"xdenser","email":"xdenser@gmail.com"},"dist":{"shasum":"cecd591956a741a504b735f90b768e21827a9f71","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.7.tgz","integrity":"sha512-Jn03SBxPs844nhgFpsulGm6JCJliFsCSJYfaV4w+03sMBj7PnzPHnMFdgD9i5QdZZK3oMwIa7KfCRmhAxkGKdA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE+8sAT/y0GvC8tMJozKrR3PsqlAHdYVQwzehXwWHgrlAiArs2P2Ovc+DSQjpkcmaiEATze7LthDPOIryABVBOJpFQ=="}]}},"0.0.8":{"name":"struct","version":"0.0.8","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{},"repositories":[{"type":"git","url":"http://github.com/xdenser/node-struct.git"}],"engines":{"node":">0.6.0"},"gitHead":"07a437f41dd0ea7a66d76df744b384277d8e705b","repository":{"type":"git","url":"http://github.com/xdenser/node-struct.git"},"homepage":"https://github.com/xdenser/node-struct","_id":"struct@0.0.8","scripts":{},"_shasum":"fb65bf5084320e26ec3d59d7dc41f0181ccea287","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"xdenser","email":"xdenser@gmail.com"},"dist":{"shasum":"fb65bf5084320e26ec3d59d7dc41f0181ccea287","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.8.tgz","integrity":"sha512-WF9mN3qgfdET61sRTe7h8MS+gvjlI7/wgmn4Ua9Ko0Bkwk/Z69ctizABuU3mM1vks57fPAf9vDShySQjjNZx3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdgRE1ChHCNZowRd1B3/abOrDhH1BOdoa5cM9hgfllHwIgBvOU3ORm33sqMXkARWwT5Gap6qunnpKhGN8n4dVZH/w="}]}},"0.0.10":{"name":"struct","version":"0.0.10","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{},"repositories":[{"type":"git","url":"git+ssh://git@github.com/xdenser/node-struct.git"}],"engines":{"node":">0.6.0"},"gitHead":"3aca0d7d0c5e637981d8f8d0251a9f702afd6f21","repository":{"type":"git","url":"git+ssh://git@github.com/xdenser/node-struct.git"},"homepage":"https://github.com/xdenser/node-struct#readme","_id":"struct@0.0.10","scripts":{},"_shasum":"e388725625be21f21c41f172c01edc9a81a3303a","_from":".","_npmVersion":"2.14.20","_nodeVersion":"4.4.0","_npmUser":{"name":"xdenser","email":"xdenser@gmail.com"},"dist":{"shasum":"e388725625be21f21c41f172c01edc9a81a3303a","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.10.tgz","integrity":"sha512-CI7mDW0S18X86pCdtGpxEWIx99enZHZaWxCMver0rAxg0wDWWdw4APYVQqW0DgvO0LmTLVDYkpgDOYMIdoEJLw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmLP2PN+ckxZ/sy3Bk0V7dfNPcW2H0v7udMC2KkxXx2AiEAqrEvQuZ6FNgoVXub+9uNBUxxlDzZkQEfzuGRHPZ0OpY="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/struct-0.0.10.tgz_1457874461423_0.34946190961636603"}},"0.0.11":{"name":"struct","version":"0.0.11","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{},"repositories":[{"type":"git","url":"git+ssh://git@github.com/xdenser/node-struct.git"}],"engines":{"node":">0.6.0"},"gitHead":"e4aba47ff6e27f3fa3b914f0ddec8fb7b386ece9","repository":{"type":"git","url":"git+ssh://git@github.com/xdenser/node-struct.git"},"homepage":"https://github.com/xdenser/node-struct#readme","_id":"struct@0.0.11","scripts":{},"_shasum":"aed5fd6ef9a74fb78f042f52091080d193eaca3a","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"xdenser","email":"xdenser@gmail.com"},"dist":{"shasum":"aed5fd6ef9a74fb78f042f52091080d193eaca3a","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.11.tgz","integrity":"sha512-zhCBDK3POhX5y1IUTr5JXY7l9Esjdi1WkhZBjZEJU8ewpwsa95l+PtLCMrYIu8VxDFCb7vr2CnuQDxDEj2K63g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1WTn+6739Mf+xsKfG6A91Ova4/NH+HwqcpMQECBX+8gIgCtgs/e03aacnaVwLpnRayxZ7Iiv3cAfKDP6pdyjQUbM="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/struct-0.0.11.tgz_1469356850598_0.14817437157034874"}},"0.0.12":{"name":"struct","version":"0.0.12","description":"Pack/Unpack multibyte binary values from/to buffers ","author":{"name":"Denys Khanzhiyev"},"main":"./index.js","maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"licenses":[{"type":"MIT"}],"dependencies":{},"repositories":[{"type":"git","url":"git+ssh://git@github.com/xdenser/node-struct.git"}],"engines":{"node":">0.6.0"},"gitHead":"71a26413604c73d6dad925d69558410913c25c41","repository":{"type":"git","url":"git+ssh://git@github.com/xdenser/node-struct.git"},"homepage":"https://github.com/xdenser/node-struct#readme","_id":"struct@0.0.12","scripts":{},"_shasum":"8330af872664e9a5bd678664524857c50908038a","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"xdenser","email":"xdenser@gmail.com"},"dist":{"shasum":"8330af872664e9a5bd678664524857c50908038a","tarball":"https://registry.npmjs.org/struct/-/struct-0.0.12.tgz","integrity":"sha512-PV2nfc79Od13idbDWQZcsBZlmeDTdPP67cOYTUWZfYE77MWGhEGgGIAFtpO1UdOvDzB3I//jbFaA09JXNRAO3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9QjtjQnoFneNdJhGOaVn3v04t2ouIwabvb5UTiL2JigIgPHjE6MDl74Nk9VODv3HsJF079y2r12iVXlwUpvQMfWI="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/struct-0.0.12.tgz_1490209850800_0.5805236962623894"}}},"maintainers":[{"name":"xdenser","email":"xdenser@gmail.com"}],"time":{"modified":"2022-06-27T01:20:19.195Z","created":"2011-09-04T19:33:59.106Z","0.0.1":"2011-09-04T19:34:01.713Z","0.0.2":"2013-01-02T14:05:19.953Z","0.0.3":"2013-07-24T19:56:38.562Z","0.0.4":"2013-09-01T08:54:04.008Z","0.0.5":"2013-09-01T09:41:38.778Z","0.0.6":"2013-09-29T12:32:20.389Z","0.0.7":"2014-07-13T17:46:11.593Z","0.0.8":"2014-07-14T06:33:50.737Z","0.0.9":"2016-03-12T19:33:55.508Z","0.0.10":"2016-03-13T13:07:43.671Z","0.0.11":"2016-07-24T10:40:52.569Z","0.0.12":"2017-03-22T19:10:52.841Z"},"author":{"name":"Denys Khanzhiyev"},"readme":"Struct\r\n======\r\nNodeJS module to work with buffers as structures (or records) of various fields (like c struct declaration, or pascal record).\r\n\r\nInstallation\r\n============\r\n\r\nTo install with [npm](http://github.com/isaacs/npm):\r\n \r\n    npm install struct\r\n    \r\n\r\nExample\r\n=======\r\n\r\nDefine some structure: \r\n\r\n\tvar Struct = require('struct');\r\n \r\n\tvar Person = Struct()\r\n\t\t.chars('firstName',10)\r\n\t\t.chars('lastName',10)\r\n\t\t.array('items',3,'chars',10)\r\n\t\t.word16Sle('balance'),\r\n\tPeople = Struct()\r\n\t\t.word8('presentCount')\r\n\t\t.array('list',2,Person);\r\n\t\t\r\nNow allocate buffer for it\r\n\t\r\n\tPeople.allocate();\r\n\tvar buf = People.buffer();\r\n\t\r\nClear buffer to see how it will change later:\r\n\t\r\n\tvar buf = Persons.buffer();\r\n\tfor (var i = 0; i < buf.length ; i++) {\r\n  \t\tbuf[i] = 0;\r\n\t}\r\n\tconsole.log(buf);\r\n\t\r\nOutput:\r\n\t<Buffer 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>\r\n\t\r\n\t\r\nNow you can access memory as defined binary structure with `fields` property in a handy manner.\t\t\r\n\r\n\tvar proxy = People.fields;\r\n\tproxy.presentCount = 2;\r\n\tconsole.log(buf);\r\n\t\r\nOutput: \r\n\t\r\n\t<Buffer 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00>\r\n\t\r\nAnd so on\r\n\r\n\tproxy.list[0].firstName = 'John';\r\n\tconsole.log(buf);\r\n\t\r\nOutput:\r\n\t<Buffer 02 4a 6f 68 6e 00 00 00 00 00 00 ...\t\r\n\t     \r\nReference\r\n=========\r\n\r\n##Struct()\r\n\r\ncreates struct object, you may define your data structure with chain calls to following methods:\r\n\r\n###word8(name)\r\ndefines one byte unsigned field, name - always defines name of field\r\n\r\n### word8Sle(name),word8Sbe(name)\r\ndefine one byte signed field\r\n\r\n### word16Sle(name),word16Sbe(name)\r\ndefine 16 bit signed field with little-endian and big-endian byte order\r\n\r\n### word16Ule(name),word16Ube(name)\r\ndefine 16 bit unsigned field with little-endian and big-endian byte order\r\n\r\n### word32Sle(name),word32Sbe(name),word32Ule(name),word32Ube(name),word64Sle(name),word64Sbe(name),word64Ule(name),word64Ube(name)\r\nsame for 32 and 64 bit fields\r\n\r\n### floatle(name),floatbe(name)\r\ndefine one float field\r\n\r\n### doublele(name),doublebe(name)\r\ndefine one double field\r\n\r\n### chars(name,length[,encoding])\r\ndefines array of chars with `encoding` ('ascii' by default) encoding, name - name of the field, length - length of array\r\n\r\n### charsnt(name,length[,encoding])\r\nsame as chars but ensure that string is null terminated and buffer remaining space is fill with \\0\r\n\r\n### array(name, length, type, ...)\r\ndefines array of fields (internally it is Struct() object with field names set to 0,1,2,... ).\r\n \r\n- `name` - name of array field;\r\n- `length` - length of array;\r\n- `type` - `string||Struct()`, string is interpreted as name of Struct()  method to call for each array element.\r\n\r\nFor example `array('numbers',5,'word16Ule')` will define array of 2 byte unsigned words (x86 byte order) with 5 elements.\r\nAny parameters that follow type will be passed to definition function. \r\nSo `array('someName',3,'chars',20)` defines 3 element array of 20 chars.\r\nYou also may pass Struct() object to make array of structures.\r\n\r\n### struct(name, Struct() )   \r\n      \r\ndefines field that itself is a structure.\r\n\r\n## Other methods\r\n\r\n### get(fieldName)\r\nallows access to field (reads value from it's offset in buffer)\r\n\r\n### set(fieldName, value)\r\nallows access to field (write value at it's offset in buffer)\r\n\r\n### allocate()\r\nallocates buffer for defined structure with proper size. This is used when you need to format data in buffer and send or write it out.\r\n \r\n### _setBuff(buffer)\r\nsets buffer reference of object to other buffer. This may be used to parse or adjust some binary data received or read from somewhere.\r\n\r\n### buffer()\r\nreturns currently used buffer. Before you may read or write to structure you have to call either allocate() or _setBuff(buffer). \r\nThis is not true only for Struct() objects that are fields themselves, as they are allocated automatically by parent Struct object.\r\n\r\n## fields property\r\nStruct().fields is a Proxy object allowing to access structure fields in a handy manner - as any other javascript object.\r\n \r\n\r\n  \r\n","homepage":"https://github.com/xdenser/node-struct#readme","repository":{"type":"git","url":"git+ssh://git@github.com/xdenser/node-struct.git"},"bugs":{"url":"http://github.com/xdenser/node-struct/issues"},"readmeFilename":"README.md","users":{"perrywu":true,"bluelovers":true,"cuidapeng":true}}