persist.js
function PersistOutNode(n) {
        RED.nodes.createNode(this,n);
        var node = this;

        node.name = n.name;
        node.storageNode = RED.nodes.getNode(n.storageNode);

        node.restore = function() {
            var msg = node.storageNode.getMessage(node.name);
            node.send(msg);
        };


        RED.events.on("nodes-started", node.restore);

        node.on("input", function(msg) {
            node.restore();
        });

        node.on('close', function(removed, done) {
            RED.events.removeListener("nodes-started", node.restore);
            done();
        });
    }
function PersistOutNode(n) {
        RED.nodes.createNode(this,n);
        var node = this;

        node.name = n.name;
        node.storageNode = RED.nodes.getNode(n.storageNode);

        node.restore = function() {
            var msg = node.storageNode.getMessage(node.name);
            node.send(msg);
        };


        RED.events.on("nodes-started", node.restore);

        node.on("input", function(msg) {
            node.restore();
        });

        node.on('close', function(removed, done) {
            RED.events.removeListener("nodes-started", node.restore);
            done();
        });
    }
function PersistOutNode ( n ) { RED . nodes . createNode ( this , n ) ; var node = this ; node . name = n . name ; node . storageNode = RED . nodes . getNode ( n . storageNode ) ; node . restore = function ( ) { var msg = node . storageNode . getMessage ( node . name ) ; node . send ( msg ) ; } ; RED . events . on ( "nodes-started" , node . restore ) ; node . on ( "input" , function ( msg ) { node . restore ( ) ; } ) ; node . on ( 'close' , function ( removed , done ) { RED . events . removeListener ( "nodes-started" , node . restore ) ; done ( ) ; } ) ; }
Replay persisted data
Replay persisted data