DailyJS

DailyJS

The JavaScript blog.


Tagssh
Featured

apps ssh meteor

Share SSH Sessions with Nutty

Posted on .

The Nutty SSH sharing service.

Nutty (GitHub: krishnasrinivas / nuttyapp, License: GPLv3) by Krishna Srinivas is a Meteor application that allows SSH sessions to be shared via a browser. A host connects to a server which can then be shared with other people. Krishna suggests that this could be useful for pair programming or support.

The Nutty server needs some configuration before you can run it yourself -- you can set up Google authentication, and it needs Amazon S3 for uploading recordings to S3. If you want to use WebRTC then you can set up PeerJS as well.

It's an interesting example of Meteor and HTML5 being used to provide a service that would be traditionally run as a system-level daemon.

Featured

testing node modules ssh cloud

Node Roundup: pkgcloud, rewire, ssh2

Posted on .

You can send in your Node projects for review through our contact form or @dailyjs.

pkgcloud

pkgcloud (GitHub: nodejitsu / pkgcloud, License: MIT, npm: pkgcloud) from Nodejitsu is a module for scripting interactions with cloud service providers. It supports various services from Joyent, Microsoft, Rackspace, and several database providers like MongoHQ and RedisToGo. The authors have attempted to unify the vocabulary used by each provider -- for example, pkgcloud uses the term 'Server' to refer to Joyent's "machines" and Amazon's "instances".

Services can be introspected and resources can be fetched. The API is naturally asynchronous, with callback arguments using the standard error-first pattern.

The roadmap promises support for more services in the future, including CDN and DNS.

rewire

rewire (License: MIT, npm: rewire by Johannes Ewald is a dependency injection implementation that can be used to inject mocks into other modules and access private variables.

As an example, consider a module within your project that uses the standard fs module to read a file. When writing tests for this module, it would be entirely possible to use rewire to modify the fs module to mock the readFile method:

var rewire = require('rewire')  
  , exampleModule = rewire('./exampleModule')
  ;

exampleModule.__set__('fs', {  
  readFile: function(path, encoding, cb) {
    cb(null, 'Success!');
  }
});

// Tests would follow...

Notice that rewire was used instead of require -- rewire itself works by appending special getters and setters to modules rather than using an eval-based solution.

SSH2

SSH2 (License: MIT, npm: ssh2) by Brian White is an SSH2 client written in pure JavaScript. It's built with the standard Node modules -- streams, buffers, events, and lots of prototype objects and regular expressions.

It supports several authentication methods, including keys, bidirectional port forwarding, execution of remote commands, interactive sessions, and SFTP. Brian has provided some detailed examples of how to use the library's event-based API.