mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
added nearly complete p2p implementation
This commit is contained in:
parent
11dacdae64
commit
5c22f575dd
25 changed files with 14320 additions and 12563 deletions
21
src/standaloneUtils/serverMaintenenceUtils.js
Normal file
21
src/standaloneUtils/serverMaintenenceUtils.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const { countQuestionsInSubjects } = require('../../dist/utils/qdbUtils.js')
|
||||
const fs = require('fs')
|
||||
|
||||
const command = process.argv[2]
|
||||
const args = process.argv.slice(3)
|
||||
|
||||
const actions = {
|
||||
qdbcount: () => {
|
||||
const qdb = JSON.parse(fs.readFileSync(args[0], 'utf-8'))
|
||||
const questionCount = countQuestionsInSubjects(qdb)
|
||||
console.log({ questionCount: questionCount })
|
||||
},
|
||||
}
|
||||
|
||||
if (actions[command]) {
|
||||
actions[command]()
|
||||
} else {
|
||||
console.log('No action for ' + command)
|
||||
console.log('Possible commands: ', Object.keys(actions))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue