mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
chore: add a tool to get the static module definitions
This commit is contained in:
parent
c412f53f11
commit
69a71cb710
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ node_modules
|
|||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
.history
|
.history
|
||||||
|
examples/moddef.json
|
||||||
|
22
examples/get_static_moddef.js
Normal file
22
examples/get_static_moddef.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
const fsPromises = require('fs/promises')
|
||||||
|
const path = require('path')
|
||||||
|
const server = require('../server')
|
||||||
|
|
||||||
|
const exportFile = path.join(__dirname, 'moddef.json')
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const def = await server.getModulesDefinitions(
|
||||||
|
path.join(__dirname, '..', 'module'),
|
||||||
|
{
|
||||||
|
'daily_signin.js': '/daily_signin',
|
||||||
|
'fm_trash.js': '/fm_trash',
|
||||||
|
'personal_fm.js': '/personal_fm',
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
|
||||||
|
fsPromises.writeFile(exportFile, JSON.stringify(def, null, 4))
|
||||||
|
console.log(`👍 Get your own definition at: ${exportFile}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
Loading…
x
Reference in New Issue
Block a user