New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rx-fs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rx-fs - npm Package Compare versions

Comparing version 1.0.0-alpha.0 to 1.0.0-alpha.1

test/e2e/copy/copy.js

25

index.js

@@ -15,8 +15,11 @@ var _ = require('lodash');

} else if (key.indexOf('Stream') > -1) {
//accumulator[key] = value;
/*
accumulator[key] = value;
/* TODO does it make sense to add these methods?
// When should we use RxNode.fromWritableStream vs. RxNode.writeToStream?
var observableKey = key.replace('Stream', 'Observable');
if (key.indexOf('Write') > -1) {
accumulator[key] = RxNode.fromWritableStream(value);
accumulator[observableKey] = RxNode.fromWritableStream(value);
} else {
accumulator[key] = RxNode.fromReadableStream(value);
// TODO how should this handle the notification that a file was opened?
accumulator[observableKey] = RxNode.fromReadableStream(value);
}

@@ -37,5 +40,5 @@ //*/

var rxFs = rxifyNodeObject(fs);
var RxFs = rxifyNodeObject(fs);
rxFs.createReadObservable = function(path, options) {
RxFs.createReadObservable = function(path, options) {
var stream = fs.createReadStream(path, options);

@@ -50,10 +53,2 @@ options = options || {};

rxFs.createWriteObservable = function(path, options) {
var stream = fs.createWriteStream(path, options);
return function(source) {
RxNode.writeToStream(source, stream);
return source;
};
};
module.exports = rxFs;
module.exports = RxFs;

2

package.json
{
"name": "rx-fs",
"version": "1.0.0-alpha.0",
"version": "1.0.0-alpha.1",
"description": "RxJs wrapper for Node's fs module.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,10 +0,19 @@

# rx-fs
# RxFs
This is an [RxJs](https://github.com/Reactive-Extensions/RxJS) wrapper for the Node.js [fs module](https://nodejs.org/api/fs.html). It is intended to track the `fs` API as closely as possible, with the following exceptions:
This is an [RxJS](https://github.com/Reactive-Extensions/RxJS) wrapper for the Node.js **[fs module](https://nodejs.org/api/fs.html)**. It is intended to track the **fs** API as closely as possible, with the following exceptions:
* If the `fs` method expects a callback, the `rx-fs` method instead returns an Observable
* `Observable` replaces `Stream`
* If the **fs** method expects a callback, the **RxFs** method instead returns an Observable.
* If the **fs** method creates a [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable), **RxFs** has an analogous method that creates an Observable, with `Stream` replaced by `Observable` in the name. For example, `RxFs.createReadStream` creates a stream and `RxFs.createReadObservable` creates an observable.
* The result from calling `fs.createReadObservable` has property `openSource`, which is an observable indicating the file has been opened.
Note that Rx.Observable has a `pipe` method on its prototype, allowing for operations like this:
```js
var source = rxFs.createReadObservable(input);
var sink = rxFs.createWriteStream(output);
source.pipe(sink);
```
Not all the methods are currently supported. Pull requests welcome!
See also [this alternative](https://github.com/trxcllnt/rxjs-fs) that has a more full-featured API but does not match the current node fs API.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc