{"id":17109251,"url":"https://github.com/kevinoid/nodecat","last_synced_at":"2025-04-13T02:32:55.985Z","repository":{"id":6285681,"uuid":"55276851","full_name":"kevinoid/nodecat","owner":"kevinoid","description":"A Node.js implementation of cat, as specified by POSIX/SUSv3.  No frills, no buffering, no charset conversion, just cat.","archived":false,"fork":false,"pushed_at":"2025-03-20T23:09:03.000Z","size":983,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T00:20:32.475Z","etag":null,"topics":["cat","cli-command","concatenate","coreutils","nodejs","posix","stream"],"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/kevinoid.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-02T04:01:09.000Z","updated_at":"2025-03-20T23:09:01.000Z","dependencies_parsed_at":"2024-01-04T02:37:47.377Z","dependency_job_id":"b6113ca9-35e5-4a85-9a4d-4319a31d469e","html_url":"https://github.com/kevinoid/nodecat","commit_stats":{"total_commits":479,"total_committers":4,"mean_commits":119.75,"dds":0.08559498956158662,"last_synced_commit":"42cecc78a3887911eb4063e902b7e8dca5a2c102"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinoid%2Fnodecat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinoid%2Fnodecat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinoid%2Fnodecat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinoid%2Fnodecat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinoid","download_url":"https://codeload.github.com/kevinoid/nodecat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657829,"owners_count":21140842,"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":["cat","cli-command","concatenate","coreutils","nodejs","posix","stream"],"created_at":"2024-10-14T16:22:40.365Z","updated_at":"2025-04-13T02:32:55.750Z","avatar_url":"https://github.com/kevinoid.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Nodecat\n========\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/kevinoid/nodecat/node.js.yml?branch=main\u0026style=flat\u0026label=build)](https://github.com/kevinoid/nodecat/actions?query=branch%3Amain)\n[![Coverage](https://img.shields.io/codecov/c/github/kevinoid/nodecat/main.svg?style=flat)](https://app.codecov.io/gh/kevinoid/nodecat/branch/main)\n[![Dependency Status](https://img.shields.io/librariesio/release/npm/nodecat.svg?style=flat)](https://libraries.io/npm/nodecat)\n[![Supported Node Version](https://img.shields.io/node/v/nodecat.svg?style=flat)](https://www.npmjs.com/package/nodecat)\n[![Version on NPM](https://img.shields.io/npm/v/nodecat.svg?style=flat)](https://www.npmjs.com/package/nodecat)\n\nA Node.js implementation of cat, as [specified by\nPOSIX/SUSv3](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cat.html).\nNo frills, no buffering, no charset conversion, just cat.\n\n## Introductory Example\n\n```sh\n$ marked README.md | nodecat header.html - footer.html \u003e README.html\n```\n\n## Features\n\n* Supports copying stdin by default or explicitly using the name `-`.\n* Copies all files byte-for-byte without requiring a valid encoding.\n* Does not buffer any input or output (beyond any buffering done by the\n  libuv/Node internals and the `stream.Readable.prototype.pipe`\n  implementation).\n* Handles both read and write errors gracefully.\n* Recognizes the `-u` option specified by POSIX (which is ignored, since\n  nodecat is always unbuffered).\n* Recognizes the `--` option delimiter, allowing filenames which begin with\n  `-` after the delimiter.\n* Asynchronous, non-blocking API to support concurrent use cases and\n  caller-provided streams.\n\n## Installation\n\n[This package](https://www.npmjs.com/package/nodecat) can be\ninstalled using [npm](https://www.npmjs.com/), either globally or locally, by\nrunning:\n\n```sh\nnpm install nodecat\n```\n\n## Recipes\n\n### Concatenate a filename starting with -\n\n```sh\n$ nodecat -- -unfortunate-name.html footer.html \u003e combined.html\n```\n\n### Concatenate to `stdout` via the API\n\n```js\nvar nodecat = require('nodecat');\nnodecat(\n  ['header.html', '-', 'footer.html'],\n  {fileStreams: {'-': process.stdin}},\n  function(err) {\n    if (err) {\n      console.error('Error concatenating files: ', err);\n    } else {\n      console.error('Done concatenating files.');\n    }\n  }\n);\n```\n\n### Concatenate to a `stream` via the API\n\nTo concatenate files into a `stream.Writable` (which may be a\n`fs.WriteStream`, `net.Socket`, `tty.WriteStream`, `stream.PassThrough`, or\nany other `stream.Writable` subtype):\n\n```js\nvar nodecat = require('nodecat');\nvar stream = require('stream');\nvar outStream = stream.PassThrough();\nvar errStream = stream.PassThrough();\nnodecat(\n  ['header.html', '-', 'footer.html'],\n  {\n    fileStreams: {'-': process.stdin},\n    outStream: outStream,\n    errStream: errStream\n  },\n  function(err) {\n    if (err) {\n      console.error('Error concatenating files: ', err);\n    } else {\n      console.error('Done concatenating files.');\n      console.error('Content:\\n', String(outStream.read()));\n    }\n  }\n);\n```\n\nNote:  When `nodecat` is called on large files and `stdout` is redirected to a\nfile, it may be useful to use `fs.createWriteStream('-', {fd: 1})` instead of\n`process.stdout`, which does [synchronous\nwrites](https://nodejs.org/api/process.html#process_process_stdout).  Be sure\nto end the stream before exiting.\n\nMore examples can be found in the [test\nspecifications](https://kevinoid.github.io/nodecat/spec).\n\n## API Docs\n\nTo use this module as a library, see the [API\nDocumentation](https://kevinoid.github.io/nodecat/api).\n\n## Contributing\n\nContributions are appreciated.  Contributors agree to abide by the [Contributor\nCovenant Code of\nConduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html).\nIf this is your first time contributing to a Free and Open Source Software\nproject, consider reading [How to Contribute to Open\nSource](https://opensource.guide/how-to-contribute/)\nin the Open Source Guides.\n\nIf the desired change is large, complex, backwards-incompatible, can have\nsignificantly differing implementations, or may not be in scope for this\nproject, opening an issue before writing the code can avoid frustration and\nsave a lot of time and effort.\n\n## Alternatives\n\nIf nodecat does not satisfy your needs, you may want to consider these\nalternatives:\n\n* [cash-cat](https://www.npmjs.com/package/cash-cat)\n* [minicat](https://www.npmjs.com/package/minicat)\n* [posix-cat](https://www.npmjs.com/package/posix-cat)\n\n## License\n\nThis project is available under the terms of the [MIT License](LICENSE.txt).\nSee the [summary at TLDRLegal](https://tldrlegal.com/license/mit-license).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinoid%2Fnodecat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinoid%2Fnodecat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinoid%2Fnodecat/lists"}