{"_id":"mmap","_rev":"9-3adb61cea06d22255d838dce847894fa","name":"mmap","description":"mmap() fds into buffers","dist-tags":{"latest":"2.0.2"},"versions":{"2.0.0":{"name":"mmap","description":"mmap() fds into buffers","license":"BSD","version":"2.0.0","main":"./index.js","scripts":{"pretest":"npm build .","test":"node run_tests.js","install":"node-gyp rebuild"},"gypfile":true,"readme":"# mmap\n\nmmap(2) bindings for node.js that work in 0.10\n\n## Installing\n\n    npm test\n    npm install -g\n\n## Usage\n\n    mmap = require(\"mmap\")\n    buffer = mmap(n_bytes, protection, flags, fd, offset)\n\n<table>\n  <tr>\n    <td><i>n_bytes</i></td>\n    <td>The number of bytes to map into memory.</td>\n  </tr>\n  <tr>\n    <td><i>protection</i></td>\n    <td>Memory protection: either <b>mmap.PROT_NONE</b> or a bitwise OR of <b>mmap.PROT_READ</b>, <b>mmap.PROT_WRITE</b> and <b>mmap.PROT_EXEC</b>.</td>\n  </tr>\n  <tr>\n    <td><i>flags</i></td>\n    <td>Flags: either <b>mmap.MAP_SHARED</b> or <b>mmap.MAP_PRIVATE</b>.</td>\n  </tr>\n  <tr>\n    <td><i>fd</i></td>\n    <td>File descriptor. You can also use a file name (string). When you do this, <b>mmap()</b> tries to do the right thing by creating or growing the file to <i>n_bytes</i> if necessary.</td>\n  </tr>\n  <tr>\n    <td><i>offset</i></td>\n    <td>File offset. Must be either zero or a multiple of <b>mmap.PAGESIZE</b>.</td>\n  </tr>\n</table>\n\nWhile a finaliser is installed to automatically unmap buffer, you can\nforce it to unmap immediately with:\n\n    buffer.unmap()\n\nYou can also [msync()](http://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html) by calling: `buffer.sync([offset, [length, [flags]]])` method:\n\n<table>\n  <tr>\n    <td><i>offset</i></td>\n    <td>The start address to sync. This argument optional, the default is 0.</td>\n  </tr>\n  <tr>\n    <td><i>length</i></td>\n    <td>The number of bytes to sync. This argument optional, the default is the entire buffer.</td>\n  </tr>\n  <tr>\n    <td><i>flags</i></td>\n    <td>Flags: either <b>mmap.MS_SYNC</b> or <b>mmap.MS_ASYNC</b> optionally bitwise OR with <b>mmap.MS_INVALIDATE</b>. This argument is optional, the default is <b>mmap.MS_SYNC</b>.</td>\n  </tr>\n</table>\n\nFor compatibility, <b>mmap.map()</b> is an alias for <b>mmap()</b>\n\n## See Also\n\n* POSIX 1003.1 [mmap](http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html) and [msync](http://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html)\n* The `example/` directory contains some sample uses of the mmap module\n* [bnoordhuis/node-mmap](https://github.com/bnoordhuis/node-mmap), the original node-mmap, on which this is based.\n","readmeFilename":"README.md","_id":"mmap@2.0.0","dist":{"shasum":"5d5305b4a1bfa7925765cc159798689b6fd6cb23","tarball":"https://registry.npmjs.org/mmap/-/mmap-2.0.0.tgz","integrity":"sha512-dyYiT3v6os25AQcY9/kIPp0XeqAvMfV8zpLafdnnPdO8AOqWF3kTTdiYNhAEZEfI1L163c25gvPAYOt1/8Ti0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBNsVWE8DFodDrx2JQizZel/UoJs6pdzHcaNlYkYmXTQIhAJBU/IusoqOah0Nxv6o5aODinxJQ44uW0gadhNBpack/"}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"geocar","email":"geocar@gmail.com"},"maintainers":[{"name":"geocar","email":"geocar@gmail.com"}]},"2.0.1":{"name":"mmap","description":"mmap() fds into buffers","license":"BSD","version":"2.0.1","main":"./index.js","repository":{"type":"git","url":"https://github.com/geocar/mmap.git"},"scripts":{"pretest":"npm build .","test":"node run_tests.js","install":"node-gyp rebuild"},"gypfile":true,"readme":"# mmap\n\nmmap(2) bindings for node.js that work in 0.10\n\n## Installing\n\n    npm test\n    npm install -g\n\n## Usage\n\n    mmap = require(\"mmap\")\n    buffer = mmap(n_bytes, protection, flags, fd, offset)\n\n<table>\n  <tr>\n    <td><i>n_bytes</i></td>\n    <td>The number of bytes to map into memory.</td>\n  </tr>\n  <tr>\n    <td><i>protection</i></td>\n    <td>Memory protection: either <b>mmap.PROT_NONE</b> or a bitwise OR of <b>mmap.PROT_READ</b>, <b>mmap.PROT_WRITE</b> and <b>mmap.PROT_EXEC</b>.</td>\n  </tr>\n  <tr>\n    <td><i>flags</i></td>\n    <td>Flags: either <b>mmap.MAP_SHARED</b> or <b>mmap.MAP_PRIVATE</b>.</td>\n  </tr>\n  <tr>\n    <td><i>fd</i></td>\n    <td>File descriptor. You can also use a file name (string). When you do this, <b>mmap()</b> tries to do the right thing by creating or growing the file to <i>n_bytes</i> if necessary.</td>\n  </tr>\n  <tr>\n    <td><i>offset</i></td>\n    <td>File offset. Must be either zero or a multiple of <b>mmap.PAGESIZE</b>.</td>\n  </tr>\n</table>\n\nWhile a finaliser is installed to automatically unmap buffer, you can\nforce it to unmap immediately with:\n\n    buffer.unmap()\n\nYou can also [msync()](http://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html) by calling: `buffer.sync([offset, [length, [flags]]])` method:\n\n<table>\n  <tr>\n    <td><i>offset</i></td>\n    <td>The start address to sync. This argument optional, the default is 0.</td>\n  </tr>\n  <tr>\n    <td><i>length</i></td>\n    <td>The number of bytes to sync. This argument optional, the default is the entire buffer.</td>\n  </tr>\n  <tr>\n    <td><i>flags</i></td>\n    <td>Flags: either <b>mmap.MS_SYNC</b> or <b>mmap.MS_ASYNC</b> optionally bitwise OR with <b>mmap.MS_INVALIDATE</b>. This argument is optional, the default is <b>mmap.MS_SYNC</b>.</td>\n  </tr>\n</table>\n\nFor compatibility, <b>mmap.map()</b> is an alias for <b>mmap()</b>\n\n## See Also\n\n* POSIX 1003.1 [mmap](http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html) and [msync](http://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html)\n* The `example/` directory contains some sample uses of the mmap module\n* [bnoordhuis/node-mmap](https://github.com/bnoordhuis/node-mmap), the original node-mmap, on which this is based.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/geocar/mmap/issues"},"_id":"mmap@2.0.1","dist":{"shasum":"e6bc4f1c8f0f4c6aff6df83c8a173f50016b256c","tarball":"https://registry.npmjs.org/mmap/-/mmap-2.0.1.tgz","integrity":"sha512-/KMdlbKZO+22BcY3NaZoky3SZuFz1m197mb3GqFfJaLAsn1zoi7/SSBv+/d2EmYYt9TyimtJIlpEhoTYOmCKtw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEW3jcRffDymkmJGOueGQ0WzDjnd4SMFBFRmAQd/+7DcAiAvRU+9d2n1tngukFuIBMOGw9etR+nusYGhVQBl7jxx0w=="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"geocar","email":"geocar@gmail.com"},"maintainers":[{"name":"geocar","email":"geocar@gmail.com"}]},"2.0.2":{"name":"mmap","description":"mmap() fds into buffers","license":"BSD","version":"2.0.2","main":"./index.js","repository":{"type":"git","url":"https://github.com/geocar/mmap.git"},"scripts":{"pretest":"npm build .","test":"node --expose-gc run_tests.js","install":"node-gyp rebuild"},"gypfile":true,"readme":"# mmap\n\nmmap(2) bindings for node.js that work in 0.10\n\n## Installing\n\n    npm test\n    npm install -g\n\n## Usage\n\n    mmap = require(\"mmap\")\n    buffer = mmap(n_bytes, protection, flags, fd, offset)\n\n<table>\n  <tr>\n    <td><i>n_bytes</i></td>\n    <td>The number of bytes to map into memory.</td>\n  </tr>\n  <tr>\n    <td><i>protection</i></td>\n    <td>Memory protection: either <b>mmap.PROT_NONE</b> or a bitwise OR of <b>mmap.PROT_READ</b>, <b>mmap.PROT_WRITE</b> and <b>mmap.PROT_EXEC</b>.</td>\n  </tr>\n  <tr>\n    <td><i>flags</i></td>\n    <td>Flags: either <b>mmap.MAP_SHARED</b> or <b>mmap.MAP_PRIVATE</b>.</td>\n  </tr>\n  <tr>\n    <td><i>fd</i></td>\n    <td>File descriptor. You can also use a file name (string). When you do this, <b>mmap()</b> tries to do the right thing by creating or growing the file to <i>n_bytes</i> if necessary.</td>\n  </tr>\n  <tr>\n    <td><i>offset</i></td>\n    <td>File offset. Must be either zero or a multiple of <b>mmap.PAGESIZE</b>.</td>\n  </tr>\n</table>\n\nWhile a finaliser is installed to automatically unmap buffer, you can\nforce it to unmap immediately with:\n\n    buffer.unmap()\n\nYou can also [msync()](http://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html) by calling: `buffer.sync([offset, [length, [flags]]])` method:\n\n<table>\n  <tr>\n    <td><i>offset</i></td>\n    <td>The start address to sync. This argument optional, the default is 0.</td>\n  </tr>\n  <tr>\n    <td><i>length</i></td>\n    <td>The number of bytes to sync. This argument optional, the default is the entire buffer.</td>\n  </tr>\n  <tr>\n    <td><i>flags</i></td>\n    <td>Flags: either <b>mmap.MS_SYNC</b> or <b>mmap.MS_ASYNC</b> optionally bitwise OR with <b>mmap.MS_INVALIDATE</b>. This argument is optional, the default is <b>mmap.MS_SYNC</b>.</td>\n  </tr>\n</table>\n\nFor compatibility, <b>mmap.map()</b> is an alias for <b>mmap()</b>\n\n## See Also\n\n* POSIX 1003.1 [mmap](http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html) and [msync](http://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html)\n* The `example/` directory contains some sample uses of the mmap module\n* [bnoordhuis/node-mmap](https://github.com/bnoordhuis/node-mmap), the original node-mmap, on which this is based.\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/geocar/mmap/issues"},"_id":"mmap@2.0.2","dist":{"shasum":"af996a8c6e442fd455b3ce773decfdf797595fcd","tarball":"https://registry.npmjs.org/mmap/-/mmap-2.0.2.tgz","integrity":"sha512-/EcKgOhr0+Jifn96ELsaccViQtdq3JqY1v3mUxyVX1JxXkpo8D36GP5P/Q6OyvRL27+dir2EiiZx9p723bB42w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDjVdzdE99pc/oEAgis1UrFZlSci924vLXS/TFTFvBMvAiEA8jk7LjRRBkLZIL+6tScY+hCkVOBwsIaXNMNbPzX1lmo="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"geocar","email":"geocar@gmail.com"},"maintainers":[{"name":"geocar","email":"geocar@gmail.com"}]}},"readme":"# mmap\n\nmmap(2) bindings for node.js that work in 0.10\n\n## Installing\n\n    npm test\n    npm install -g\n\n## Usage\n\n    mmap = require(\"mmap\")\n    buffer = mmap(n_bytes, protection, flags, fd, offset)\n\n<table>\n  <tr>\n    <td><i>n_bytes</i></td>\n    <td>The number of bytes to map into memory.</td>\n  </tr>\n  <tr>\n    <td><i>protection</i></td>\n    <td>Memory protection: either <b>mmap.PROT_NONE</b> or a bitwise OR of <b>mmap.PROT_READ</b>, <b>mmap.PROT_WRITE</b> and <b>mmap.PROT_EXEC</b>.</td>\n  </tr>\n  <tr>\n    <td><i>flags</i></td>\n    <td>Flags: either <b>mmap.MAP_SHARED</b> or <b>mmap.MAP_PRIVATE</b>.</td>\n  </tr>\n  <tr>\n    <td><i>fd</i></td>\n    <td>File descriptor. You can also use a file name (string). When you do this, <b>mmap()</b> tries to do the right thing by creating or growing the file to <i>n_bytes</i> if necessary.</td>\n  </tr>\n  <tr>\n    <td><i>offset</i></td>\n    <td>File offset. Must be either zero or a multiple of <b>mmap.PAGESIZE</b>.</td>\n  </tr>\n</table>\n\nWhile a finaliser is installed to automatically unmap buffer, you can\nforce it to unmap immediately with:\n\n    buffer.unmap()\n\nYou can also [msync()](http://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html) by calling: `buffer.sync([offset, [length, [flags]]])` method:\n\n<table>\n  <tr>\n    <td><i>offset</i></td>\n    <td>The start address to sync. This argument optional, the default is 0.</td>\n  </tr>\n  <tr>\n    <td><i>length</i></td>\n    <td>The number of bytes to sync. This argument optional, the default is the entire buffer.</td>\n  </tr>\n  <tr>\n    <td><i>flags</i></td>\n    <td>Flags: either <b>mmap.MS_SYNC</b> or <b>mmap.MS_ASYNC</b> optionally bitwise OR with <b>mmap.MS_INVALIDATE</b>. This argument is optional, the default is <b>mmap.MS_SYNC</b>.</td>\n  </tr>\n</table>\n\nFor compatibility, <b>mmap.map()</b> is an alias for <b>mmap()</b>\n\n## See Also\n\n* POSIX 1003.1 [mmap](http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html) and [msync](http://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html)\n* The `example/` directory contains some sample uses of the mmap module\n* [bnoordhuis/node-mmap](https://github.com/bnoordhuis/node-mmap), the original node-mmap, on which this is based.\n","maintainers":[{"name":"geocar","email":"geocar@gmail.com"}],"time":{"modified":"2022-06-20T00:07:44.400Z","created":"2013-07-19T06:41:04.306Z","2.0.0":"2013-07-19T06:41:06.902Z","2.0.1":"2013-07-19T06:42:34.514Z","2.0.2":"2014-01-03T21:54:54.662Z"},"repository":{"type":"git","url":"https://github.com/geocar/mmap.git"}}