summaryrefslogtreecommitdiff
path: root/file.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2018-05-07 09:06:04 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2018-05-07 09:06:04 +0200
commit5caf4e48174533710243e8eeaf52567795ec9d01 (patch)
tree1396f09bd14c3c4e1af3164ef924f2190b3f949f /file.js
parentded191658af266a764332b9a1b72d628de3d5b6e (diff)
downloadbrokentalents-5caf4e48174533710243e8eeaf52567795ec9d01.tar.gz
brokentalents-5caf4e48174533710243e8eeaf52567795ec9d01.zip
move files to backend subdir, push data in submodule
Diffstat (limited to 'file.js')
-rw-r--r--file.js39
1 files changed, 0 insertions, 39 deletions
diff --git a/file.js b/file.js
deleted file mode 100644
index b750921..0000000
--- a/file.js
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/node
-
-const R = require('ramda'),
- Future = require('fluture'),
- fs = require('fs'),
- fsPath = require('fs-path');
-
-function loadFPayloads(config) {
- return R.curry((file) =>
- Future.node((cb) => fs.readFile(file, 'utf8', cb))
- .chain(Future.encase(JSON.parse))
- );
-}
-
-function saveFPayloads(config) {
- return R.curry((file, data) =>
- Future.node((cb) => fsPath.writeFile(file, JSON.stringify(data), cb))
- .map(() => data)
- );
-}
-
-function saveFPayloadsTimestamped(config) {
- return R.curry((timestamp, data) =>
- saveFPayloads(config)(config.pattern(timestamp), data)
- );
-}
-
-function loadFPayloadsTimestamped(config) {
- return R.curry((timestamp) =>
- loadFPayloads(config)(config.pattern(timestamp))
- );
-}
-
-module.exports = {
- loadFPayloads,
- loadFPayloadsTimestamped,
- saveFPayloads,
- saveFPayloadsTimestamped,
-};