Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Added calling Excel and passing payloads #50

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

dfinke commented May 5, 2013

No description provided.

@tjanczuk tjanczuk commented on the diff May 6, 2013

README.md
+ "StDev": 29.011491975882016,
+ "Var": 841.66666666666663
+}
+```
+
+## How to: marshal data between PowerShell and node.js
+
+Edge.js can marshal any JSON-serializable value between .NET and node.js. Edge also supports marshaling between node.js `Buffer` instance and a .NET `byte[]` array to help you efficiently pass binary data.
+
+You can call .NET from node.js and pass in a complex JavaScript object as follows:
+
+```javascript
+var edge = require('edge');
+
+var powershellFunction = edge.func('ps', function () {/*
+@"
@tjanczuk

tjanczuk May 6, 2013

Owner

Why does this need to be enclosed in quotes?

@dfinke

dfinke May 6, 2013

Contributor

@" "@ is a PowerShell here-string. I'm using it to print text and execute the subexpression $().

@tjanczuk tjanczuk commented on the diff May 6, 2013

README.md
+ console.log(result[0]);
+});
+```
+
+```
+anInteger=1
+aNumber=3.1415
+aString=foo
+aBoolean=True
+aBuffer=0 0 0 0 0 0 0 0 0 0
+anArray=1 foo
+anObject.a=foo
+anObject.b=12
+```
+
+You can go from PowerShell to node.js. Here we advantage of PowerShell evaluating commands.
@tjanczuk

tjanczuk May 6, 2013

Owner

we advantage -> we take advantage?

@tjanczuk tjanczuk commented on the diff May 6, 2013

README.md
+
+ if(error) throw error;
+
+ console.log(result[0]);
+});
+```
+
+```
+{
+ "Median": 50.5,
+ "StDev": 29.011491975882016,
+ "Var": 841.66666666666663
+}
+```
+
+## How to: marshal data between PowerShell and node.js
@tjanczuk

tjanczuk May 6, 2013

Owner

I wonder if it would make sense to keep that level of detail on the README.md of edge-ps and just link it from here. That way you will have the documentation close to code in case you rev the module.

@paulcbetts

paulcbetts May 6, 2013

Contributor

+1, this is all super cool, but how much is the rest of the content in the README being diluted by adding a huge PS + Excel section? Maybe this belongs in a docs folder instead?

@tjanczuk

tjanczuk May 6, 2013

Owner

I was hoping to highlight attractive use cases of PS in the context of edge.js, similarly to the few ideas at http://tjanczuk.github.io/edge/#/26. Perhaps the Excel code/sample could be moved out to wiki or some such and just linked from here?

@dfinke

dfinke May 6, 2013

Contributor

Agreed. I need think through how to word it so I can talk about the cool aspect without an example that demos it.

Owner

tjanczuk commented Aug 5, 2014

As discussed this is a Wiki material as opposed to README.

@tjanczuk tjanczuk closed this Aug 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment