mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-13 13:29:56 +00:00
2916cb6fd9
Thanks @pmario
37 lines
756 B
JavaScript
37 lines
756 B
JavaScript
/*\
|
|
title: $:/core/modules/commands/quit.js
|
|
type: application/javascript
|
|
module-type: command
|
|
|
|
Immediately ends the TiddlyWiki process
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
exports.info = {
|
|
name: "quit",
|
|
synchronous: true
|
|
};
|
|
|
|
var Command = function(params,commander,callback) {
|
|
var self = this;
|
|
this.params = params;
|
|
this.commander = commander;
|
|
this.callback = callback;
|
|
};
|
|
|
|
Command.prototype.execute = function() {
|
|
// The Node.js docs are very clear that exiting in this way can be dangerous because pending I/O is cancelled.
|
|
// TODO: stop the server listeners explicitly so that Node.js will exit the process naturally.
|
|
process.exit();
|
|
return null;
|
|
};
|
|
|
|
exports.Command = Command;
|
|
|
|
})();
|