build(ci): change the package name

This commit is contained in:
ImFurina 2025-10-17 20:06:30 +08:00
parent d78a20ea11
commit 6d33efee47
5 changed files with 29 additions and 30 deletions

View File

@ -32,10 +32,6 @@ jobs:
with: with:
node-version: 20 node-version: 20
registry-url: 'https://npm.pkg.github.com' 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 - name: Publish to GitHub Packages
run: npm publish --access public run: npm publish --access public
env: env:

View File

@ -40,7 +40,7 @@ set PORT=4000 && node app.js # Windows
## 在线体验与文档 ## 在线体验与文档
- [在线文档](https://neteasecloudmusicapienhanced.js.org/) - [在线文档](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) - [Dockerhub 主页](https://hub.docker.com/r/moefurina/ncm-api)
## 常见部署方式 ## 常见部署方式
@ -58,6 +58,7 @@ set PORT=4000 && node app.js # Windows
```bash ```bash
docker pull moefurina/ncm-api:latest docker pull moefurina/ncm-api:latest
``` ```
或指定版本(与 package.json 中版本号一致): 或指定版本(与 package.json 中版本号一致):
```bash ```bash
@ -66,6 +67,7 @@ docker pull moefurina/ncm-api:4.29.0
``` ```
### 2. 运行容器 ### 2. 运行容器
```bash ```bash
docker run -d \ docker run -d \
--name ncm-api \ --name ncm-api \
@ -73,13 +75,12 @@ docker run -d \
moefurina/ncm-api:latest moefurina/ncm-api:latest
``` ```
运行后访问 http://localhost:3000 即可使用 API。 运行后访问 http://localhost:3000 即可使用 API。
### 3. 环境变量 ### 3. 环境变量
| 变量名 | 默认值 | 说明 | | 变量名 | 默认值 | 说明 |
|--------|--------|------| | -------------------------- | ------------------------------------ | ------------------------------------------------------------------------------ |
| **CORS_ALLOW_ORIGIN** | `*` | 允许跨域请求的域名。若需要限制,请指定具体域名(例如 `https://example.com`)。 | | **CORS_ALLOW_ORIGIN** | `*` | 允许跨域请求的域名。若需要限制,请指定具体域名(例如 `https://example.com`)。 |
| **ENABLE_PROXY** | `false` | 是否启用反向代理功能。 | | **ENABLE_PROXY** | `false` | 是否启用反向代理功能。 |
| **PROXY_URL** | `https://your-proxy-url.com/?proxy=` | 代理服务地址。仅当 `ENABLE_PROXY=true` 时生效。 | | **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 支持直接在 Node.js 项目中引入和调用,返回 Promise
```js ```js
const { login_cellphone, user_cloud } = require('@neteaseapireborn/api') const {
login_cellphone,
user_cloud,
} = require('@neteasecloudmusicapienhanced/api')
async function main() { async function main() {
const result = await login_cellphone({ phone: '手机号', password: '密码' }) const result = await login_cellphone({ phone: '手机号', password: '密码' })
console.log(result) console.log(result)
@ -137,7 +141,7 @@ main()
## TypeScript 支持 ## TypeScript 支持
```ts ```ts
import { banner } from '@neteaseapireborn/api' import { banner } from '@neteasecloudmusicapienhanced/api'
banner({ type: 0 }).then((res) => console.log(res)) banner({ type: 0 }).then((res) => console.log(res))
``` ```

View File

@ -1,4 +1,4 @@
import { banner, lyric } from '@neteaseapireborn/api' import { banner, lyric } from '@neteasecloudmusicapienhanced/api'
import { logger } from '../util/logger.js' import { logger } from '../util/logger.js'
banner({ type: 0 }).then((res) => { banner({ type: 0 }).then((res) => {
logger.info(res) logger.info(res)

View File

@ -1,6 +1,6 @@
{ {
"name": "@neteaseapireborn/api", "name": "@neteasecloudmusicapienhanced/api",
"version": "4.29.9", "version": "4.29.11",
"description": "为停更的网易云音乐 NodeJs API 提供持续的维护!", "description": "为停更的网易云音乐 NodeJs API 提供持续的维护!",
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",

View File

@ -59,13 +59,13 @@ $ set HOST=127.0.0.1 && node app.js
支持 npx 方式运行,会自动安装依赖和运行 支持 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` v3.31.0 后支持 Node.js 调用,导入的方法为`module`内的文件名,返回内容包含`status``body`,`status`为状态码,`body`为请求返回内容,参考`module_example` 文件夹下的 `test.js`
```js ```js
const { login_cellphone, user_cloud } = require('@neteaseapireborn/api') const {
login_cellphone,
user_cloud,
} = require('@neteasecloudmusicapienhanced/api')
async function main() { async function main() {
try { try {
const result = await login_cellphone({ const result = await login_cellphone({
@ -158,7 +161,7 @@ main()
```ts ```ts
// test.ts // test.ts
import { banner } from '@neteaseapireborn/api' import { banner } from '@neteasecloudmusicapienhanced/api'
banner({ type: 0 }).then((res) => { banner({ type: 0 }).then((res) => {
console.log(res) console.log(res)
}) })
@ -3989,7 +3992,6 @@ ONLINE 已发布
**可选参数** **可选参数**
- 状态(非必填): - 状态(非必填):
- `displayStatus: null`(默认):返回所有状态的声音 - `displayStatus: null`(默认):返回所有状态的声音
- `displayStatus: "ONLINE"`:已发布的声音 - `displayStatus: "ONLINE"`:已发布的声音
- `displayStatus: "AUDITING"`:审核中的声音 - `displayStatus: "AUDITING"`:审核中的声音
@ -4002,19 +4004,16 @@ ONLINE 已发布
- `limit: 20`:每次返回的声音数量(最多 200 个) - `limit: 20`:每次返回的声音数量(最多 200 个)
- 搜索关键词: - 搜索关键词:
- `name: null`:返回所有的声音 - `name: null`:返回所有的声音
- `name: [关键词]`:返回包含指定关键词的声音文件 - `name: [关键词]`:返回包含指定关键词的声音文件
- `offset: 0`:偏移量,用于分页,默认为 0表示从第一个声音开始获取 - `offset: 0`:偏移量,用于分页,默认为 0表示从第一个声音开始获取
- 博客: - 博客:
- `radioId: null`:返回所有电台的声音 - `radioId: null`:返回所有电台的声音
- `radioId: [播客id]`:返回特定播客的声音 - `radioId: [播客id]`:返回特定播客的声音
- 是否公开: - 是否公开:
- `type: null`:返回所有类型的声音 - `type: null`:返回所有类型的声音
- `type: "PUBLIC"`:返回公开的声音 - `type: "PUBLIC"`:返回公开的声音
- `type: "PRIVATE"`:返回隐私的声音 - `type: "PRIVATE"`:返回隐私的声音