OK, so I realized that it helps me where I want to be. The first is using gulp -header to insert a variable declaration into my Javascript file using this code:
In GULP:
var d = new Date(); .pipe(header("var timeStamp = '" + d +"';"))
Then, in my Javascript file, I set the property in the object, which is a function, and sets the timeStamp property that I was looking for, getting the value from the timeStamp variable introduced above using gulp -header, for example:
In the JS file, the header function inserts the following:
var timeStamp = 'Tue Dec 08 2015 15:15:11 GMT-0800 (PST)';
And then my function in the JS object is simple:
ts: function(){ object.timeStamp = timeStamp; },
Which, when called, starts and sets a timestamp inside the object.
There seems to be an easier way to do this, but for now it works.
If you have ideas for improving it, I would like to hear them!
source share