mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 12:43:12 +03:00
Сервис конфига
This commit is contained in:
parent
08bbb5dd67
commit
a2eccb53e9
4 changed files with 64 additions and 0 deletions
1
config/.gitignore
vendored
Normal file
1
config/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
node_modules/
|
13
config/main.js
Normal file
13
config/main.js
Normal file
|
@ -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;
|
28
config/package-lock.json
generated
Normal file
28
config/package-lock.json
generated
Normal file
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
22
config/package.json
Normal file
22
config/package.json
Normal file
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue