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