UNPKG
thethingbox-node-timestamp
Version:
latest (2.0.0)
2.0.0
timestamp node for thethingbox, compatible with node-red
thethingbox.io
thethingbox-node-timestamp
/
timestamp
/
timestamp.js
19 lines
(11 loc)
•
311 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module
.
exports
=
function
(
RED
) {
function
TimestampNode
(
n
) {
RED
.
nodes
.
createNode
(
this
,n);
this
.
name
= n.
name
;
this
.
on
(
"input"
,
function
(
msg
) { msg.
timestamp
=
new
Date
().
toISOString
();
this
.
send
(msg); }); }
RED
.
nodes
.
registerType
(
"timestamp"
,
TimestampNode
); }