summaryrefslogtreecommitdiffstats
path: root/lib/json/encodeFile.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/json/encodeFile.js')
-rw-r--r--lib/json/encodeFile.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/json/encodeFile.js b/lib/json/encodeFile.js
new file mode 100644
index 0000000..03b3450
--- /dev/null
+++ b/lib/json/encodeFile.js
@@ -0,0 +1,16 @@
+
+/**
+ Return a JSON representation of a file
+
+ @param {File} file
+ @return {Object}
+*/
+function encodeFileToJson(file) {
+ return {
+ path: file.getPath(),
+ mtime: file.getMTime(),
+ type: file.getType()
+ };
+}
+
+module.exports = encodeFileToJson;