mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2025-10-22 06:03:09 +00:00
build(ci): change the package name
This commit is contained in:
parent
d78a20ea11
commit
6d33efee47
4
.github/workflows/npm.yml
vendored
4
.github/workflows/npm.yml
vendored
@ -32,10 +32,6 @@ jobs:
|
||||
with:
|
||||
node-version: 20
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
- name: Update package name for GitHub Packages
|
||||
run: |
|
||||
json=`cat package.json`
|
||||
echo "$json" | jq '.name = "@neteasecloudmusicapienhanced/api"' > package.json
|
||||
- name: Publish to GitHub Packages
|
||||
run: npm publish --access public
|
||||
env:
|
||||
|
14
README.MD
14
README.MD
@ -40,7 +40,7 @@ set PORT=4000 && node app.js # Windows
|
||||
## 在线体验与文档
|
||||
|
||||
- [在线文档](https://neteasecloudmusicapienhanced.js.org/)
|
||||
- [NPM 包地址](https://www.npmjs.com/package/@neteaseapireborn/api)
|
||||
- [NPM 包地址](https://www.npmjs.com/package/@neteasecloudmusicapienhanced/api)
|
||||
- [Dockerhub 主页](https://hub.docker.com/r/moefurina/ncm-api)
|
||||
|
||||
## 常见部署方式
|
||||
@ -58,6 +58,7 @@ set PORT=4000 && node app.js # Windows
|
||||
```bash
|
||||
docker pull moefurina/ncm-api:latest
|
||||
```
|
||||
|
||||
或指定版本(与 package.json 中版本号一致):
|
||||
|
||||
```bash
|
||||
@ -66,6 +67,7 @@ docker pull moefurina/ncm-api:4.29.0
|
||||
```
|
||||
|
||||
### 2. 运行容器
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name ncm-api \
|
||||
@ -73,13 +75,12 @@ docker run -d \
|
||||
moefurina/ncm-api:latest
|
||||
```
|
||||
|
||||
|
||||
运行后访问 http://localhost:3000 即可使用 API。
|
||||
|
||||
### 3. 环境变量
|
||||
|
||||
| 变量名 | 默认值 | 说明 |
|
||||
|--------|--------|------|
|
||||
| -------------------------- | ------------------------------------ | ------------------------------------------------------------------------------ |
|
||||
| **CORS_ALLOW_ORIGIN** | `*` | 允许跨域请求的域名。若需要限制,请指定具体域名(例如 `https://example.com`)。 |
|
||||
| **ENABLE_PROXY** | `false` | 是否启用反向代理功能。 |
|
||||
| **PROXY_URL** | `https://your-proxy-url.com/?proxy=` | 代理服务地址。仅当 `ENABLE_PROXY=true` 时生效。 |
|
||||
@ -124,7 +125,10 @@ docker run -d -p 3000:3000 moefurina/ncm-api:latest
|
||||
支持直接在 Node.js 项目中引入和调用,返回 Promise:
|
||||
|
||||
```js
|
||||
const { login_cellphone, user_cloud } = require('@neteaseapireborn/api')
|
||||
const {
|
||||
login_cellphone,
|
||||
user_cloud,
|
||||
} = require('@neteasecloudmusicapienhanced/api')
|
||||
async function main() {
|
||||
const result = await login_cellphone({ phone: '手机号', password: '密码' })
|
||||
console.log(result)
|
||||
@ -137,7 +141,7 @@ main()
|
||||
## TypeScript 支持
|
||||
|
||||
```ts
|
||||
import { banner } from '@neteaseapireborn/api'
|
||||
import { banner } from '@neteasecloudmusicapienhanced/api'
|
||||
banner({ type: 0 }).then((res) => console.log(res))
|
||||
```
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { banner, lyric } from '@neteaseapireborn/api'
|
||||
import { banner, lyric } from '@neteasecloudmusicapienhanced/api'
|
||||
import { logger } from '../util/logger.js'
|
||||
banner({ type: 0 }).then((res) => {
|
||||
logger.info(res)
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@neteaseapireborn/api",
|
||||
"version": "4.29.9",
|
||||
"name": "@neteasecloudmusicapienhanced/api",
|
||||
"version": "4.29.11",
|
||||
"description": "为停更的网易云音乐 NodeJs API 提供持续的维护!",
|
||||
"scripts": {
|
||||
"start": "node app.js",
|
||||
|
@ -59,13 +59,13 @@ $ set HOST=127.0.0.1 && node app.js
|
||||
支持 npx 方式运行,会自动安装依赖和运行
|
||||
|
||||
```
|
||||
npx @neteaseapireborn/api@版本号
|
||||
npx @neteasecloudmusicapienhanced/api@版本号
|
||||
```
|
||||
|
||||
或者运行
|
||||
|
||||
```
|
||||
npx @neteaseapireborn/api@latest
|
||||
npx @neteasecloudmusicapienhanced/api@latest
|
||||
|
||||
```
|
||||
|
||||
@ -135,7 +135,10 @@ v3.3.0 后支持使用 PAC 代理,如 `?proxy=http://192.168.0.1/proxy.pac`
|
||||
v3.31.0 后支持 Node.js 调用,导入的方法为`module`内的文件名,返回内容包含`status`和`body`,`status`为状态码,`body`为请求返回内容,参考`module_example` 文件夹下的 `test.js`
|
||||
|
||||
```js
|
||||
const { login_cellphone, user_cloud } = require('@neteaseapireborn/api')
|
||||
const {
|
||||
login_cellphone,
|
||||
user_cloud,
|
||||
} = require('@neteasecloudmusicapienhanced/api')
|
||||
async function main() {
|
||||
try {
|
||||
const result = await login_cellphone({
|
||||
@ -158,7 +161,7 @@ main()
|
||||
|
||||
```ts
|
||||
// test.ts
|
||||
import { banner } from '@neteaseapireborn/api'
|
||||
import { banner } from '@neteasecloudmusicapienhanced/api'
|
||||
banner({ type: 0 }).then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
@ -3989,7 +3992,6 @@ ONLINE 已发布
|
||||
**可选参数**
|
||||
|
||||
- 状态(非必填):
|
||||
|
||||
- `displayStatus: null`(默认):返回所有状态的声音
|
||||
- `displayStatus: "ONLINE"`:已发布的声音
|
||||
- `displayStatus: "AUDITING"`:审核中的声音
|
||||
@ -4002,19 +4004,16 @@ ONLINE 已发布
|
||||
- `limit: 20`:每次返回的声音数量(最多 200 个)
|
||||
|
||||
- 搜索关键词:
|
||||
|
||||
- `name: null`:返回所有的声音
|
||||
- `name: [关键词]`:返回包含指定关键词的声音文件
|
||||
|
||||
- `offset: 0`:偏移量,用于分页,默认为 0,表示从第一个声音开始获取
|
||||
|
||||
- 博客:
|
||||
|
||||
- `radioId: null`:返回所有电台的声音
|
||||
- `radioId: [播客id]`:返回特定播客的声音
|
||||
|
||||
- 是否公开:
|
||||
|
||||
- `type: null`:返回所有类型的声音
|
||||
- `type: "PUBLIC"`:返回公开的声音
|
||||
- `type: "PRIVATE"`:返回隐私的声音
|
||||
|
Loading…
x
Reference in New Issue
Block a user