# nodert-streams

> Turn WinRT streams to node.js streams

Latest version **0.0.5** (published 2014-10-09) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install nodert-streams
pnpm add nodert-streams
yarn add nodert-streams
bun add nodert-streams
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2014-10-09 |
| First published | 2014-08-14 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 667 |
| Author | saary |
| Maintainers | nadavbar |
| Keywords | NodeRT, WinRT, Streams |

## Links

- npm: https://www.npmjs.com/package/nodert-streams
- Repository: https://github.com/NodeRT/NodeRT
- Homepage: https://github.com/NodeRT/NodeRT/tree/master/modules/nodert-streams
- Issues: https://github.com/NodeRT/NodeRT/issues
- npm.io page: https://npm.io/package/nodert-streams

## Dependencies (1)

- [windows.storage.streams](https://npm.io/package/windows.storage.streams.md) *

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2014-10-09
- 0.0.4 — 2014-10-09
- 0.0.3 — 2014-08-14
- 0.0.2 — 2014-08-14
- 0.0.1 — 2014-08-14

## README

nodert-streams
=====
Turns a WinRT stream (Wrapped using NodeRT) into a node.js stream.
For more information on NodeRT, take a look at: <a href="https://github.com/NodeRT/NodeRT" target="_blank">https://github.com/NodeRT/NodeRT</a>

You can download this module from NPM by running the following cmd:

```
npm install nodert-streams
```

If you have cloned the git repo (and not downloaded thm module from NPM) run the following command from inside the directory:

```
node-gyp rebuild
```

(For both of the above commands, make sure that <a href="https://github.com/TooTallNate/node-gyp" target="_blank">node-gyp</a> and all of its perquisites are installed)

<h3>API:</h3>

* Exposes an **InputStream** object which can be initiated by passing a WinRT input stream, this object behaves like a readable nodejs stream.
* Exposes an **OutputStream** object which can be initiated by passing a WinRT input stream, this object behaves like a writeable nodejs stream.


<h3>Prerequisites:</h3>

In order to use nodert-streams, please make sure first to generate and compile the following NodeRT module and place it in a node_modules directory near by:
* windows.storage.streams

Here is an example of using nodert-streams for piping contents of a file to stdout:

```javascript
var streams = require('windows.storage.streams');
var storage = require('windows.storage');
var nodert_streams = require('nodert-streams');
var StorageFile = storage.StorageFile;

// open a file from the documents library
storage.KnownFolders.documentsLibrary.getFileAsync('document.txt', function(err, file) {
  if (err) {
    return console.info(err);
  }
  // call openAsync in order to retrieve the stream
  file.openAsync(storage.FileAccessMode.read, function(err, fileStream) {
    if (err) {
      return console.info(err);
    }
    // convert the winrt stream to a node.js stream
    var nodeStream = streams.InputStream(fileStream);
    // pipe the stream to the stdout
    nodeStream.pipe(process.stdout);
  });
});
```

---
_Source: https://npm.io/package/nodert-streams · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
