Socket
Socket
Sign inDemoInstall

switchback

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

switchback

Command-line library for apps like heroku and jitsu


Version published
Weekly downloads
61K
decreased by-4.1%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install switchback

Usage

Commands

Simple

var sys = require('sys')
  , switchback = require('switchback');

switchback.command('echo', function() {
  sys.puts(Array.prototype.slice.call(arguments, 0).join(' '));
}).exec();

With description

switchback.command('echo', {
  description: 'This will echo back what you write',
  method: function() {
    sys.puts(Array.prototype.slice.call(arguments, 0).join(' '));
  }
}).exec();

With scope

var foo = {bar: 'baz'};

switchback.command('foo', {
  scope: foo,
  description: 'Print out this.bar',
  method: function() {
    sys.puts(this.bar);
  }
}).exec();

Namespaces

switchback.namespace('auth', function(switchback) {
  switchback.describe('Authentication methods')
  .command('login', {
    scope: auth_service,
    description: 'Login to service',
    method: auth_service.login
  })
  .command('logout', {
    scope: auth_service,
    description: 'Logout of service',
    method: auth_service.logout
  })
}).exec();

FAQs

Package last updated on 28 Dec 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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