From a2eccb53e9fa2c246c8c4e7634a34f03f7eabbb1 Mon Sep 17 00:00:00 2001 From: Redume Date: Tue, 30 Jul 2024 18:05:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B2=D0=B8=D1=81=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/.gitignore | 1 + config/main.js | 13 +++++++++++++ config/package-lock.json | 28 ++++++++++++++++++++++++++++ config/package.json | 22 ++++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 config/.gitignore create mode 100644 config/main.js create mode 100644 config/package-lock.json create mode 100644 config/package.json 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" + } +}