New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

microscope-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

microscope-cli

microscopejs command line interface librairies

latest
npmnpm
Version
0.1.0
Version published
Weekly downloads
1
-80%
Maintainers
1
Weekly downloads
 
Created
Source

microscope-cli

microscopejs command line interface librairies.

Application

Class for Command Line Interface console application.

Usage sample:

required properties:

  • templatesRoot
  • controllersRoot
// Imports
var Application = require('microscope-cli').Application;

// ConsoleApplication class.
module.exports = Application.extend({

	templatesRoot: __dirname + '/templates',
	controllersRoot: __dirname + '/controllers',

	options: [
		{flags: '-S, --shiv', description: 'add html5 shiv'}
	],

	initialize: function () {
		this.run();
	}
});

CliController

Cli Controller class. parse command line arguments

Usage sample:

required properties:

  • commands
    • command (required) -- command to parse
    • action (required) -- controller method to callback
    • description (optional) -- command description
// Imports
var CliController = require('microscope-cli').CliController;
var ProjectForm   = require('../forms/ProjectForm');

// HomeCliController class
module.exports = CliController.extend({

	commands: [
		{command: 'new_project <projectName>', action: 'new', description: 'create project'},
		{command: 'new', action: 'create', description: 'display project form'}
	],

	new: function (projectName) {
		if(this.kernel.getOption('shiv')) {
			this.print('Adding html5 shiv librairy', 'danger');
		}
		this.print('create new project: ' + projectName, 'danger');
	},

	create: function () {
		new ProjectForm({kernel: this.kernel});
	}
});

Form

Console form with model and rich inputs (list, password, ...)

Usage sample:

required properties:

  • model
  • response (function)
// Imports
var Form = require('microscope-cli').Form;

// ProjectForm class
module.exports = Form.extend({

	model: [{
		type: "input",
		name: "projectName",
		message: "What is your project name ?"
	}],

	initialize: function () {
		this.render();
	},

	response: function (answers) {
		this.print(answers.projectName, 'danger');
	}
});

FAQs

Package last updated on 10 Feb 2015

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