Gathering detailed insights and metrics for microscope-console
Gathering detailed insights and metrics for microscope-console
Gathering detailed insights and metrics for microscope-console
Gathering detailed insights and metrics for microscope-console
npm install microscope-console
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
6
Console application librairie - play well with gulp and npm workflow.
Using homebrew:
brew install node
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
npm install gulp -g
npm install
npm test
gulp build
grunt test
grunt docs
Create console application wich rich form:
old school way (ES5):
1var Form = require('microscope-console').Form; 2var ejs = require("gulp-ejs"); 3 4/** 5 * Project form 6 * Es5 syntax 7 */ 8var ProjectForm = Form.extend({ 9 10 model: [{ 11 type: 'input', 12 name: 'projectName', 13 message: 'What is your project name ?', 14 validate: this.validate 15 }], 16 17 // input validation here 18 validate: function (input) { 19 var done = this.async(); 20 done(true); 21 }, 22 23 // manage user answer here 24 response: function (answer) { 25 this.src([__dirname + '/../templates/index.ejs']) 26 .pipe(ejs({projectName: answer.projectName})) 27 .pipe(this.dest(__dirname + '/../' + answer.projectName + '/')); 28 29 var output = '\nYour project '+ answer.projectName +' was generated !'; 30 console.log(output.green); 31 } 32}); 33 34module.exports = ProjectForm;
new school way (ES6 with babel):
1var Form = require('microscope-console').Form; 2var ejs = require("gulp-ejs"); 3 4/** 5 * Project form with es6 syntax 6 * native extend es5 form 7 */ 8class ProjectForm extends Form { 9 10 get model(){ 11 return [{ 12 type: 'input', 13 name: 'projectName', 14 message: 'What is your project name ?', 15 validate: this.validate 16 }]; 17 } 18 19 // input validation here 20 validate(input){ 21 var done = this.async(); 22 done(true); 23 } 24 25 // manage user answer here 26 response(answer){ 27 this.src([__dirname + '/../templates/index.ejs']) 28 .pipe(ejs({projectName: answer.projectName})) 29 .pipe(this.dest(__dirname + '/../' + answer.projectName + '/')); 30 31 var output = '\nYour project '+ answer.projectName +' was generated !'; 32 console.log(output.green); 33 } 34} 35 36module.exports = ProjectForm;
Instatiate it and compose tasks console applications using gulp
1var ProjectForm = require('./forms/ProjectForm'); 2var c = new ProjectForm();
No vulnerabilities found.
No security vulnerabilities found.