{"id":21070867,"url":"https://github.com/nodert/nodert-streams","last_synced_at":"2025-08-24T02:15:42.999Z","repository":{"id":57131613,"uuid":"70240769","full_name":"NodeRT/nodert-streams","owner":"NodeRT","description":null,"archived":false,"fork":false,"pushed_at":"2017-11-28T16:39:56.000Z","size":19,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-11T12:01:42.762Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NodeRT.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":"2016-10-07T11:31:37.000Z","updated_at":"2023-11-03T06:27:03.000Z","dependencies_parsed_at":"2022-08-31T19:41:51.255Z","dependency_job_id":null,"html_url":"https://github.com/NodeRT/nodert-streams","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeRT%2Fnodert-streams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeRT%2Fnodert-streams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeRT%2Fnodert-streams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeRT%2Fnodert-streams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NodeRT","download_url":"https://codeload.github.com/NodeRT/nodert-streams/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254474039,"owners_count":22077203,"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":[],"created_at":"2024-11-19T18:48:42.659Z","updated_at":"2025-05-16T05:31:10.954Z","avatar_url":"https://github.com/NodeRT.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"nodert-streams\n=====\nTurns a WinRT stream (Wrapped using NodeRT) into a node.js stream.\nFor more information on NodeRT, take a look at: \u003ca href=\"https://github.com/NodeRT/NodeRT\" target=\"_blank\"\u003ehttps://github.com/NodeRT/NodeRT\u003c/a\u003e\n\nYou can download this module from NPM by running the following cmd:\n\n```\nnpm install @nodert-win10/nodert-streams\n```\n\nIf you have cloned the git repo (and not downloaded thm module from NPM) run the following command from inside the directory:\n\n```\nnode-gyp rebuild\n```\n\n(For both of the above commands, make sure that \u003ca href=\"https://github.com/TooTallNate/node-gyp\" target=\"_blank\"\u003enode-gyp\u003c/a\u003e and all of its perquisites are installed)\n\n\u003ch3\u003eAPI:\u003c/h3\u003e\n\n* **InputStream** class - instantiated by passing a WinRT input stream in the constructor, this object behaves like a readable nodejs stream.\n* **OutputStream** class - instantiated by passing a WinRT input stream in the constructor, this object behaves like a writeable nodejs stream.\n* **toIBuffer** function - accepts a node.js buffer and returns an IBuffer object which points to the same underlying native buffer.\n\nHere is an example of using nodert-streams for piping contents of a file to stdout:\n\n```javascript\nvar streams = require('@nodert-win10/windows.storage.streams');\nvar storage = require('@nodert-win10/windows.storage');\nvar nodert_streams = require('@nodert-win10/nodert-streams');\nvar StorageFile = storage.StorageFile;\n\n// open a file from the documents library\nstorage.KnownFolders.documentsLibrary.getFileAsync('document.txt', function(err, file) {\n  if (err) {\n    return console.info(err);\n  }\n  // call openAsync in order to retrieve the stream\n  file.openAsync(storage.FileAccessMode.read, function(err, fileStream) {\n    if (err) {\n      return console.info(err);\n    }\n    // convert the winrt stream to a node.js stream\n    var nodeStream = streams.InputStream(fileStream.getInputStreamAt(0));\n    // pipe the stream to the stdout\n    nodeStream.pipe(process.stdout);\n  });\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodert%2Fnodert-streams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodert%2Fnodert-streams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodert%2Fnodert-streams/lists"}