mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-22 08:13:11 +01:00
17 lines
379 B
JavaScript
Vendored
17 lines
379 B
JavaScript
Vendored
import * as fs from 'fs';
|
|
import { Engine } from 'php-parser';
|
|
|
|
const parser = new Engine({
|
|
parser: {
|
|
extractDoc: false,
|
|
},
|
|
ast: {
|
|
withPositions: true,
|
|
},
|
|
})
|
|
|
|
const phpFile = fs.readFileSync("./config/2fauth.php")
|
|
const phpContent = parser.parseCode(phpFile)
|
|
const version = phpContent.children[0].expr.items[0].value.value
|
|
|
|
export default version |