ez-streams
Advanced tools
Comparing version 0.2.1 to 1.0.0
52
API.md
@@ -5,53 +5,51 @@ # ez-streams | ||
* [ez-streams/lib/devices/array](lib/devices/array.md) | ||
* [ez-streams/src/devices/array](lib/devices/array.md) | ||
Array readers and writers | ||
* [ez-streams/lib/devices/buffer](lib/devices/buffer.md) | ||
* [ez-streams/src/devices/buffer](lib/devices/buffer.md) | ||
In-memory buffer streams | ||
* [ez-streams/lib/devices/child_process](lib/devices/child_process.md) | ||
* [ez-streams/src/devices/child_process](lib/devices/child_process.md) | ||
EZ Stream wrappers for node child processes | ||
* [ez-streams/lib/devices/console](lib/devices/console.md) | ||
* [ez-streams/src/devices/console](lib/devices/console.md) | ||
Console EZ streams | ||
* [ez-streams/lib/devices/file](lib/devices/file.md) | ||
* [ez-streams/src/devices/file](lib/devices/file.md) | ||
File based EZ streams | ||
* [ez-streams/lib/devices/galaxy](lib/devices/galaxy.md) | ||
Stream constructors for galaxy | ||
* [ez-streams/lib/devices/generic](lib/devices/generic.md) | ||
* [ez-streams/src/devices/generic](lib/devices/generic.md) | ||
Generic stream constructors | ||
* [ez-streams/lib/devices/http](lib/devices/http.md) | ||
* [ez-streams/src/devices/http](lib/devices/http.md) | ||
HTTP EZ Streams | ||
* [ez-streams/lib/devices/net](lib/devices/net.md) | ||
* [ez-streams/src/devices/net](lib/devices/net.md) | ||
TCP and socket EZ Streams | ||
* [ez-streams/lib/devices/node](lib/devices/node.md) | ||
* [ez-streams/src/devices/node](lib/devices/node.md) | ||
EZ Stream wrappers for native node streams | ||
* [ez-streams/lib/devices/queue](lib/devices/queue.md) | ||
* [ez-streams/src/devices/queue](lib/devices/queue.md) | ||
Queue device | ||
* [ez-streams/lib/devices/std](lib/devices/std.md) | ||
* [ez-streams/src/devices/std](lib/devices/std.md) | ||
EZ wrappers for standard I/O streams | ||
* [ez-streams/lib/devices/string](lib/devices/string.md) | ||
* [ez-streams/src/devices/string](lib/devices/string.md) | ||
In-memory string streams | ||
* [ez-streams/lib/devices/uturn](lib/devices/uturn.md) | ||
* [ez-streams/src/devices/uturn](lib/devices/uturn.md) | ||
Special device that transforms a writer into a reader | ||
* [ez-streams/lib/helpers/binary](lib/helpers/binary.md) | ||
* [ez-streams/src/helpers/binary](lib/helpers/binary.md) | ||
helpers for binary streams | ||
* [ez-streams/lib/mappers/convert](lib/mappers/convert.md) | ||
* [ez-streams/src/mappers/convert](lib/mappers/convert.md) | ||
Encoding mappers | ||
* [ez-streams/lib/mappers/json](lib/mappers/json.md) | ||
* [ez-streams/src/mappers/json](lib/mappers/json.md) | ||
JSON mappers | ||
* [ez-streams/lib/node-wrappers](lib/node-wrappers.md) | ||
* [ez-streams/src/node-wrappers](lib/node-wrappers.md) | ||
Wrappers for node.js streams | ||
* [ez-streams/lib/reader](lib/reader.md) | ||
* [ez-streams/src/reader](lib/reader.md) | ||
EZ Streams core reader API | ||
* [ez-streams/lib/transforms/csv](lib/transforms/csv.md) | ||
* [ez-streams/src/transforms/csv](lib/transforms/csv.md) | ||
Stream transform for CSV files | ||
* [ez-streams/lib/transforms/cut](lib/transforms/cut.md) | ||
* [ez-streams/src/transforms/cut](lib/transforms/cut.md) | ||
Transform to cut string and binary streams | ||
* [ez-streams/lib/transforms/json](lib/transforms/json.md) | ||
* [ez-streams/src/transforms/json](lib/transforms/json.md) | ||
"Simple" JSON streams | ||
* [ez-streams/lib/transforms/lines](lib/transforms/lines.md) | ||
* [ez-streams/src/transforms/lines](lib/transforms/lines.md) | ||
Stream transform for line-oriented text streams | ||
* [ez-streams/lib/transforms/multipart](lib/transforms/multipart.md) | ||
* [ez-streams/src/transforms/multipart](lib/transforms/multipart.md) | ||
Stream transform for MIME multipart | ||
* [ez-streams/lib/transforms/xml](lib/transforms/xml.md) | ||
* [ez-streams/src/transforms/xml](lib/transforms/xml.md) | ||
Simple XML parser and formatter | ||
* [ez-streams/lib/writer](lib/writer.md) | ||
* [ez-streams/src/writer](lib/writer.md) | ||
EZ Streams core writer API |
"use strict"; | ||
module.exports = require('./lib'); | ||
module.exports = require('./lib/' + require('streamline-runtime').runtime); |
{ | ||
"name": "ez-streams", | ||
"description": "EZ streams for node.js", | ||
"version": "0.2.1", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"author": "Bruno Jouhier", | ||
"repository": { | ||
@@ -13,7 +15,12 @@ "type": "git", | ||
"dependencies": { | ||
"streamline": "^0.10.15", | ||
"streamline-fs": "^0.1.1" | ||
"streamline-runtime": "^1.0.12" | ||
}, | ||
"author": "Bruno Jouhier", | ||
"devDependencies": { | ||
"babel": "^5.8.0", | ||
"babel-plugin-streamline": "^1.0.8" | ||
}, | ||
"scripts": { | ||
"prepublish": "node build.js || nodejs build.js" | ||
}, | ||
"main": "index.js" | ||
} |
@@ -11,4 +11,2 @@ # Easy Streams for node.js | ||
EZ streams are also compatible with [galaxy](https://github.com/Sage/galaxy). See [Galaxy-support](#galaxy-support) below for details. | ||
<a name="installation"/> | ||
@@ -222,3 +220,3 @@ ## Installation | ||
The array functions are nice but they have limited power. They work well to process stream entries independently from each other but they don't allow us to do more complex operation like combining several entries into a bigger one, or splitting one entry into several smaller ones, or a mix of both. This is something we typically do when we parse text streams: we receive chunks of texts; we look for special boundaries and we emit the items that we have isolated between boundaries. Usally, there is not a one to one correspondance between the chunks that we receive and the items that we emit. | ||
The array functions are nice but they have limited power. They work well to process stream entries independently from each other but they don't allow us to do more complex operation like combining several entries into a bigger one, or splitting one entry into several smaller ones, or a mix of both. This is something we typically do when we parse text streams: we receive chunks of texts; we look for special boundaries and we emit the items that we have isolated between boundaries. Usually, there is not a one to one correspondance between the chunks that we receive and the items that we emit. | ||
@@ -297,3 +295,3 @@ The `transform` function is designed to handle these more complex operations. Typical code looks like: | ||
<a name="node-interop"/> | ||
## Interoperabily with native node.js streams | ||
## Interoperability with native node.js streams | ||
@@ -477,41 +475,2 @@ `ez-streams` are fully interoperable with native node.js streams. | ||
<a name="galaxy-support"/> | ||
## Galaxy support | ||
EZ streams is the recommended streams package for [galaxy](https://github.com/Sage/galaxy). The API is overloaded to facilitate integration with generator functions. | ||
If you develop with galaxy, you should use the API as follows: | ||
* add a `Star` postfix to the _reducer_ methods (the methods that have `_` as first parameter: `forEach`, `every`, `some`, `reduce`, `pipe`, `toArray`). You should also `yield` on these `Star` calls. | ||
* add a `G` (for generator/galaxy postfix to the non _reducer_ methods. | ||
* pass generator functions (`function*(...) { ... }`) instead of regular asynchronous functions (`function(_, ...) { ...}`) to the methods that expect a callback (`forEach`, `map`, `filter`, `transform`, ...). | ||
For example, instead of: | ||
``` javascript | ||
console.log("pi~=" + 4 * numberReader(10000).filter(function(_, n) { | ||
return n % 2; // keep only odd numbers | ||
}).map(function(_, n) { | ||
return n % 4 === 1 ? 1 / n : -1 / n; | ||
}).reduce(_, function(_, res, val) { | ||
return res + val; | ||
}, 0)); | ||
``` | ||
you would write: | ||
``` javascript | ||
console.log("pi~=" + 4 * (yield numberReader(10000).filterG(function*(n) { | ||
return n % 2; // keep only odd numbers | ||
}).mapG(function*(n) { | ||
return n % 4 === 1 ? 1 / n : -1 / n; | ||
}).reduceStar(function*(res, val) { | ||
return res + val; | ||
}, 0))); | ||
``` | ||
_Note:_ do not forget the `*` after `function` in the functions inside your chains; and do not forget to `yield` on reducers (`reduceStar` in the example above). | ||
See the [galaxy unit test](test/server/galaxy-test.js) for more examples. | ||
<a name="api"/> | ||
@@ -518,0 +477,0 @@ ## API |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
1
246798
2
87
129
488
4
+ Addedstreamline-runtime@^1.0.12
+ Addedcolors@1.4.0(transitive)
+ Addeddetect-libc@1.0.3(transitive)
+ Addedfibers@3.1.1(transitive)
+ Addedregenerator-runtime@0.10.5(transitive)
+ Addedstreamline-runtime@1.2.0(transitive)
- Removedstreamline@^0.10.15
- Removedstreamline-fs@^0.1.1
- Removedamdefine@1.0.1(transitive)
- Removedfibers@1.0.15(transitive)
- Removedgalaxy@0.1.12(transitive)
- Removedsource-map@0.1.43(transitive)
- Removedstreamline@0.10.17(transitive)
- Removedstreamline-fs@0.1.1(transitive)