{"_id":"@4qwerty7/syspipe","_rev":"1-6f849c0c7e9ef001c0315f71a18acb29","name":"@4qwerty7/syspipe","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.5":{"name":"@4qwerty7/syspipe","version":"0.1.5","description":"Access to the operating system native pipe implementation","main":"build/Release/syspipe.node","scripts":{"install":"node-gyp rebuild"},"repository":{"type":"git","url":"git+https://github.com/jpenalbae/syspipe.git"},"keywords":["pipe","syscall","native","ospipe","syspipe"],"author":{"name":"Jaime Peñalba/Menci"},"license":"LGPL-3.0","gypfile":true,"engines":{"node":">= 8.0"},"dependencies":{"node-addon-api":"*"},"gitHead":"b255a75cc005a3878b2328d5ab1965d1ac09d2c2","bugs":{"url":"https://github.com/jpenalbae/syspipe/issues"},"homepage":"https://github.com/jpenalbae/syspipe#readme","_id":"@4qwerty7/syspipe@0.1.5","_nodeVersion":"10.19.0","_npmVersion":"7.8.0","dist":{"integrity":"sha512-Uv6f569x9DuHDaRfGm/udwOUsfTnjTTY3Wb5HD4yGBw+eNWOAAn4IPIKKWExjKovhZECl16mXf3N3BL9y4WV2g==","shasum":"b36cb125d4d6de8196be20cdd78dd60167357f89","tarball":"https://registry.npmjs.org/@4qwerty7/syspipe/-/syspipe-0.1.5.tgz","fileCount":7,"unpackedSize":67983,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgt52ZCRA9TVsSAnZWagAAWY4P/jkM5XgKirSnLkA96qNZ\nKiS7VfIojLXOgV0X/pMqtR/2mEixRNtm1sbjvz736A6kwEFiCfTIsZgTSQMb\nMbxQUbclIdrz/dB3n3jl4pfPQfO7oSJkBDxysrweFgWmWNOo/oT2fsTD4VHI\n6o2hEAopwzWrdcPcIi1dPWE4EiVX9avxtTjmkdGHOGkrBwQVuZUkUTevVvhk\nuLIumegJkjzr62ptnNf+eMfph7J+VAiSilgT4H61WSKzGLilag8J+6I6h9f4\nm0ZKb4ln7UDVaAoP+HEtRjF/21qwOTsaRPd8SM26pv5bFSQpNR0BAnvCnqZe\n5F4rtb52Wz9aFmju0/C+nE/EuHIaj5MbXKQpw/J6jniawSwmAIfoLsRVkOy+\nOPd5E5Z648kqMUX1evM9n088Ss969Sdmc1iEKRskdmnZvQJLwlAHgkQRX6/8\nA9MYTYu47YFuXsWUdpxXlVPPimCRV1UcfNi861rzLzSZJe7Srra+wg4cjPZE\n5/4xm+lnMpU/p/2MQwShVQwwQG9fdoCq7t2pgFGnQP39+J/+1oDk0jvgItkj\nPZhYihh7eY1irwCHe0eqQI7bzJcPieEe61UlWuQwE9StiaVR4n8J6HCXr4qJ\nmMQSa8EcX4868xdG0TMdo9SHhkgffCE5v6WDQZ8CjoZzJ3m1QaP6LPI/POae\nEUmK\r\n=61cG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrtLbL5H73yIQOj2pTjgv0I5JGhE7P2U+/aDaHnsPGyQIhALT+oNrl6waC4npuIgLTJ/Yt5tc2z7kH96IEeJg2vJfH"}]},"_npmUser":{"name":"4qwerty7","email":"ebpqwerty472123@gmail.com"},"directories":{},"maintainers":[{"name":"4qwerty7","email":"ebpqwerty472123@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/syspipe_0.1.5_1622646169642_0.8244123931869005"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-02T15:02:49.596Z","0.1.5":"2021-06-02T15:02:49.782Z","modified":"2022-04-04T10:47:19.953Z"},"maintainers":[{"name":"4qwerty7","email":"ebpqwerty472123@gmail.com"}],"description":"Access to the operating system native pipe implementation","homepage":"https://github.com/jpenalbae/syspipe#readme","keywords":["pipe","syscall","native","ospipe","syspipe"],"repository":{"type":"git","url":"git+https://github.com/jpenalbae/syspipe.git"},"author":{"name":"Jaime Peñalba/Menci"},"bugs":{"url":"https://github.com/jpenalbae/syspipe/issues"},"license":"LGPL-3.0","readme":"# Syspipe\n\n[![Build Status](https://travis-ci.org/jpnalbae/syspipe.svg?branch=master)](https://travis-ci.org/jpenalbae/syspipe)\n\nnode.js module to access operating system native pipe implementation. For more info check  \"man 2 pipe\"\n\nThis interface simply gives you the ability to call the operating system `pipe` system call. It will return an object with the input and output file descriptors\n\n```\n$ node\n> require('syspipe').pipe()\n{ read: 13, write: 14 }\n```\n\nThis is generally not useful for most node program, as the pipe has a limited size imposed by the os, and if you exceed that your program will block until it is read -- and since node is single threaded by nature, you will not be able to read from the pipe and you end up deadlocked.\n\nHowever where this extension is useful, is if you have a native threaded extension which requires data to be read from a FD, then is a handy way of passing data from the node envirionment to the extension.\n\n\n# Install\n```\n$ npm install syspipe\n```\n\n# Usage\n```js\nvar fs = require('fs');\nvar syspipe = require('syspipe');\n\nvar buf = new Buffer(1024);\nvar read = 0;\n\nvar pipe = syspipe.pipe();\nfs.writeSync(pipe.write, 'hello world');\nread = fs.readSync(pipe.read, buf, 0, 1024, null);\n\nconsole.log('Pipe read: ' + buf.slice(0, read).toString());\n```\n\nNative pipes can also be useful to interact with child processes executed from node.js in a sync manner.\n\nExample:\n```js\nvar proc = require('child_process');\nvar fs = require('fs');\nvar syspipe = require('syspipe');\n\nvar buf = new Buffer(1024);\nvar read = 0;\n\n\nvar pipe = syspipe.pipe();\nvar options = { stdio: ['pipe', pipe.write, 'pipe'] };\nvar ls = proc.spawn('r2', ['-q0', '/bin/ls'], options);\n\nvar OUT = pipe.read;\nvar IN = ls.stdin['_handle'].fd;\n\n\nread = fs.readSync(OUT, buf, 0, 1024, null);\nconsole.log('[+] read ' + read + ' bytes');\n\nfs.writeSync(IN, 'f\\n');\nread = fs.readSync(OUT, buf, 0, 1024, null);\nvar result = buf.slice(0, read-1);\n\nconsole.log(result.toString());\nconsole.log('[+] Read: ' + read + ' bytes');\n\nfs.writeSync(IN, 'q\\n');\n```\n","readmeFilename":"README.md"}