mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
onExit() is similar to the onLoad() callback. onExit() is called on each module just before the process exits. This can be used to check state in unit tests, but not to perform I/O. The process will forcibly exit as soon as all of the onExit callbacks are made.
19 lines
229 B
JavaScript
19 lines
229 B
JavaScript
var c = require("b/c.js");
|
|
var string = "A";
|
|
|
|
exports.A = function () {
|
|
return string;
|
|
};
|
|
|
|
exports.C = function () {
|
|
return c.C();
|
|
};
|
|
|
|
exports.D = function () {
|
|
return c.D();
|
|
};
|
|
|
|
function onExit () {
|
|
string = "A done";
|
|
}
|