diff --git a/config/.gitignore b/config/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/config/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/config/main.js b/config/main.js new file mode 100644 index 0000000..753eba9 --- /dev/null +++ b/config/main.js @@ -0,0 +1,13 @@ +const fs = require('fs'); +const yaml = require('yaml'); + +const config = () => { + try { + fs.readFileSync('../config.yaml', 'utf-8'); + } catch { return } + + return yaml.parse(fs.readFileSync('../config.yaml', 'utf-8')); +} + + +module.exports = config; \ No newline at end of file diff --git a/config/package-lock.json b/config/package-lock.json new file mode 100644 index 0000000..6f0d56d --- /dev/null +++ b/config/package-lock.json @@ -0,0 +1,28 @@ +{ + "name": "config", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "config", + "version": "1.0.0", + "license": "GPL-3.0-or-later", + "dependencies": { + "yaml": "^2.5.0" + } + }, + "node_modules/yaml": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", + "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + } + } +} diff --git a/config/package.json b/config/package.json new file mode 100644 index 0000000..aca086e --- /dev/null +++ b/config/package.json @@ -0,0 +1,22 @@ +{ + "name": "config", + "version": "1.0.0", + "main": "main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Redume/Kekkai.git" + }, + "author": "Redume", + "license": "GPL-3.0-or-later", + "bugs": { + "url": "https://github.com/Redume/Kekkai/issues" + }, + "homepage": "https://github.com/Redume/Kekkai#readme", + "description": "", + "dependencies": { + "yaml": "^2.5.0" + } +}