mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-04 12:32:09 +08:00
remove-npmview-dependency
This commit is contained in:
parent
55c3b3e45a
commit
710a9b6ed2
14
app.js
14
app.js
@ -4,23 +4,25 @@ const path = require('path')
|
|||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const app = express()
|
const app = express()
|
||||||
let cache = apicache.middleware
|
let cache = apicache.middleware
|
||||||
var npmview = require('npmview')
|
const { exec } = require('child_process');
|
||||||
npmview('NeteaseCloudMusicApi', function(err, version, moduleInfo) {
|
exec('npm info NeteaseCloudMusicApi version', (err, stdout, stderr) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err)
|
console.error(err);
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
const onlinePackageVersion = stdout.trim();
|
||||||
const package = require('./package.json')
|
const package = require('./package.json')
|
||||||
if (package.version < version) {
|
if (package.version < onlinePackageVersion) {
|
||||||
console.log(
|
console.log(
|
||||||
'最新版:Version:' +
|
'最新版:Version:' +
|
||||||
version +
|
onlinePackageVersion +
|
||||||
',当前版本:' +
|
',当前版本:' +
|
||||||
package.version +
|
package.version +
|
||||||
',请及时更新'
|
',请及时更新'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 跨域设置
|
// 跨域设置
|
||||||
app.all('*', function(req, res, next) {
|
app.all('*', function(req, res, next) {
|
||||||
if (req.path !== '/' && !req.path.includes('.')) {
|
if (req.path !== '/' && !req.path.includes('.')) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "NeteaseCloudMusicApi",
|
"name": "NeteaseCloudMusicApi",
|
||||||
"version": "2.20.0",
|
"version": "2.19.0",
|
||||||
"description": "网易云音乐 NodeJS 版 API",
|
"description": "网易云音乐 NodeJS 版 API",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node app.js",
|
"start": "node app.js",
|
||||||
@ -18,8 +18,7 @@
|
|||||||
"apicache": "^1.2.1",
|
"apicache": "^1.2.1",
|
||||||
"big-integer": "^1.6.28",
|
"big-integer": "^1.6.28",
|
||||||
"express": "^4.16.3",
|
"express": "^4.16.3",
|
||||||
"request": "^2.85.0",
|
"request": "^2.85.0"
|
||||||
"npmview": "^0.0.4"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"intelli-espower-loader": "^1.0.1",
|
"intelli-espower-loader": "^1.0.1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user