git.schokokeks.org
Repositories
Help
Report an Issue
fs-draft.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
784b48a
Branches
Tags
master
midgard
vorlage
fs-draft.git
tools
join.js
schon vielversprechend
Christian Fraß
commited
784b48a
at 2018-08-21 21:40:56
join.js
Blame
History
Raw
const _fs = require("fs"); let data_master = {}; const dir_source = "source/data"; _fs.readdir( dir_source, (error, names) => { names.forEach( (name) => { const path = (dir_source + "/" + name); const content = _fs.readFileSync(path); const data_segment = JSON.parse(content); const key = name.split(".")[0]; data_master[key] = data_segment; } ); console.info(JSON.stringify(data_master)); } );