{"id":18204436,"url":"https://github.com/3p3r/node-named-pipe","last_synced_at":"2025-04-02T13:31:58.267Z","repository":{"id":53104511,"uuid":"124720451","full_name":"3p3r/node-named-pipe","owner":"3p3r","description":"Linux named pipes in NodeJS (mkfifo)","archived":false,"fork":false,"pushed_at":"2021-04-06T15:57:37.000Z","size":15,"stargazers_count":3,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T01:51:21.377Z","etag":null,"topics":["fifo","fifo-queue","ipc","named-pipes","pipes"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3p3r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-11T03:39:30.000Z","updated_at":"2024-02-06T23:31:27.000Z","dependencies_parsed_at":"2022-09-09T21:10:49.006Z","dependency_job_id":null,"html_url":"https://github.com/3p3r/node-named-pipe","commit_stats":null,"previous_names":["sepehr-laal/node-named-pipe"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3p3r%2Fnode-named-pipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3p3r%2Fnode-named-pipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3p3r%2Fnode-named-pipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3p3r%2Fnode-named-pipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3p3r","download_url":"https://codeload.github.com/3p3r/node-named-pipe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246823842,"owners_count":20839783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fifo","fifo-queue","ipc","named-pipes","pipes"],"created_at":"2024-11-03T11:04:18.956Z","updated_at":"2025-04-02T13:31:57.940Z","avatar_url":"https://github.com/3p3r.png","language":"JavaScript","readme":"# node-named-pipe\n\nLinux named pipes in NodeJS (mkfifo) \n[![CircleCI](https://circleci.com/gh/sepehr-laal/node-named-pipe.svg?style=svg)](https://circleci.com/gh/sepehr-laal/node-named-pipe)\n\n```bash\nnpm install named-pipe\n```\n\nThis library creates Linux pipes without the use of a C++ binding and through shell execution.\n\n## Dependencies\n\nNone! your shell needs to support `mkfifo` though. Try `mkfifo --help` in a shell and see if you have access to it.\n\n## Cool! what can I do with pipes (a.k.a example code)?\n\nYou can use Linux pipes for a very simple RPC. **note that Linux pipes by default will BLOCK if no other process is reading from the other end!**.\n\nIn your Node process:\n\n```JS\nconst path = '/tmp/test';\nawait mkfifoPromise(path);\nsetInterval(\n  appendFileSync.bind(null, path,\n    `${new Date().toISOString()}: hello fron Node!\\n`\n  ),\n  1000\n);\n```\n\nAnd in a separate shell:\n\n```bash\n$ tail -f /tmp/test\n2018-03-11T05:37:16.328Z: hello fron Node!\n2018-03-11T05:37:16.328Z: hello fron Node!\n...\n```\n\nFull source code of this example is located in [example.js](example.js).\n\n## API\n\nThis library provides three variants of mkfifo in NodeJS.\n\n### sync\n\nSignature:\n\n```TS\nconst mkfifoSync: (path: string, permission?: number = 644);\n```\n\nUsage:\n\n```JS\nconst { mkfifoSync } = require('named-pipe');\nmkfifoSync('/tmp/fifo');\n```\n\n### promise\n\n```TS\nconst mkfifoPromise: (path: string, permission?: number = 644);\n```\n\nUsage:\n\n```JS\nconst { mkfifoPromise } = require('named-pipe');\nawait mkfifoPromise('/tmp/fifo').catch(console.error);\n```\n\n### async\n\n```TS\nconst mkfifo: (path: string, permission?: number = 644, callback: Function);\n```\n\nUsage:\n\n```JS\nconst { mkfifo } = require('named-pipe');\nmkfifo('/tmp/fifo', 644, (error) =\u003e {\n  // 'error' will be non-null if unable to create the pipe\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3p3r%2Fnode-named-pipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3p3r%2Fnode-named-pipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3p3r%2Fnode-named-pipe/lists"}