Node.js
NodeJS चौखटे
खोज…
वेब सर्वर फ्रेमवर्क
एक्सप्रेस
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!');
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});
कोआ
var koa = require('koa');
var app = koa();
app.use(function *(next){
var start = new Date;
yield next;
var ms = new Date - start;
console.log('%s %s - %s', this.method, this.url, ms);
});
app.use(function *(){
this.body = 'Hello World';
});
app.listen(3000);
कमांड लाइन इंटरफ़ेस फ्रेमवर्क
Commander.js
var program = require('commander');
program
.version('0.0.1')
program
.command('hi')
.description('initialize project configuration')
.action(function(){
console.log('Hi my Friend!!!');
});
program
.command('bye [name]')
.description('initialize project configuration')
.action(function(name){
console.log('Bye ' + name + '. It was good to see you!');
});
program
.command('*')
.action(function(env){
console.log('Enter a Valid command');
terminate(true);
});
program.parse(process.argv);
Vorpal.js
const vorpal = require('vorpal')();
vorpal
.command('foo', 'Outputs "bar".')
.action(function(args, callback) {
this.log('bar');
callback();
});
vorpal
.delimiter('myapp$')
.show();
Modified text is an extract of the original Stack Overflow Documentation
के तहत लाइसेंस प्राप्त है CC BY-SA 3.0
से संबद्ध नहीं है Stack Overflow