Adding request works (mostly)
Everything works except adding the new request back to the list; this proof of concept is a go, and will be merged to master
This commit is contained in:
12
src/api/json.mjs
Normal file
12
src/api/json.mjs
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict'
|
||||
|
||||
import fs from 'fs'
|
||||
|
||||
/**
|
||||
* Read and parse a JSON file
|
||||
* @param {string} path The path to the file
|
||||
* @param {string} encoding The encoding of the file (defaults to UTF-8)
|
||||
* @return {*} The parsed contents of the file
|
||||
*/
|
||||
export default (path, encoding = 'utf-8') =>
|
||||
JSON.parse(fs.readFileSync(path, encoding))
|
||||
Reference in New Issue
Block a user