NodeJs

 

 

node js

http://nodejs.org/

 


Some notes I’ve seen say to install the 32 bit version on a 64bit system. In some cases, because IIS Express only ships as 32bit. But if you’re not using IIS (Express), can you use 64bit?

 

I ended up using these notes and not integrating with IIS (yet?).

 

Since I’m working in Emacs, I’ve been updating notes @ EmacsWiki:NodeJs

 

I’ve installed node and js-comint, but tab-completion is not supported. Nor in swank-js, AFAIK (which I haven’t tried yet)

 

upgrading & installation

(on windows, at least) Just run the latest installer.

 

Can use Chocolatey: cinst nodejs.install to install node and npm

 

Do NOT run cinst nodejs - Chocolately’s nodejs is an alias for nodejs.commandline which simply installs Node.exe to the Chocolatey folder. Does not include NPM.

 

Once node and npm are installed, running npm i -g npm will update npm.

 

npm installation

If you’re getting a Error: No compatible version found: [foo@’^n.n.n’] you may need to update to the latest version of node and npm (see above).

 

 

link dump

http://substack.net/how_I_write_modules
http://substack.net/shared_rendering_in_node_and_the_browser

 

 

Shell Scripting

http://www.phpied.com/javascript-shell-scripting/

 

Write your shell scripts in JavaScript, via Node.js

Transforming HTML with Node.js and jQuery
New Node.js module “lazylines”: read a text stream, line by line

 

task automation

 

http://flippinawesome.org/2013/07/29/writing-a-command-line-utility-using-node

 

Parsing text files using node.js

 

See also: Jake, JavaScript.ShellScripting

 

 

REPL (Read Eval Print Loop)

http://nodejs.org/docs/v0.3.1/api/repl.html
How do I use node’s REPL?
https://npmjs.org/package/node-web-repl
http://stackoverflow.com/questions/6220420/node-js-multi-line-string

 

There are a few special REPL commands:

.break - While inputting a multi-line expression, sometimes you get lost or just don’t care about completing it. .break will start over.
.clear - Resets the context object to an empty object and clears any multi-line expression.
.exit - Close the I/O stream, which will cause the REPL to exit.
.help - A:Show this list of special commands.

 

ultra REPL

https://github.com/Benvie/Node.js-Ultra-REPL

 

Installation instructions say to use an included .cmd file to launch, but I found it tried to launch PUTTY for no reason I could see (in the, say, 30 seconds I spent worrying about it).

 

However, the following worked:

  1. launch windows shell
  2. cd to \path\node_modules\ultra-repl\bin
  3. node ultra-repl.js

 

UPDATE: (a few minutes later) As I wrote the above, I was slightly suspicious, as the upper-left of the launched nodejs instance looked like the putty logo.

 

It is.

 

I looked at the source code, and saw that it had an INVARIANT launch of putty if the environment was windows (which mine is).

 

I tried the .cmd file a second time, and it launched fine.
Not sure what happened the first time around.
I _should have_ grabbed a screencap.

 

link dump

http://cs.brown.edu/courses/csci1320/labs/node_lab.html
http://ofps.oreilly.com/titles/9781449398583/chap1_id35940135.html

 

http://geekswithblogs.net/shaunxu/archive/2012/09/14/node.js-adventure---node.js-on-windows.aspx
http://www.nodebeginner.org/
http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js

 

markov chain module for node.js
https://github.com/exratione/state-engines
https://github.com/substack/node-markov

 

 

Learning

Learn Node.js Completely and with Confidence - book recommendations and pace of study based on them

 

nodeschool.io - provides (via npm) four command-line based “lesson plans” (here’s a review)

  1. Learn You the Node.js For Much Win!
  2. Stream Adventure
  3. Level Me Up Scotty
  4. Functional Javascript

 

 

 

 

package.json

https://blog.nodejitsu.com/package-dependencies-done-right

 

 

Shared rendering in node and browser

http://substack.net/shared_rendering_in_node_and_the_browser - that is, browserify

 

 

See Also

JavaScript.ShellScripting

 

 

Tags

JavaScript shell scripting serverside