Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
da3844c
feat: Implement plugin system for NodeLink
Tapao-NonSen Nov 4, 2025
93a6a38
Merge branch 'PerformanC:v3' into v3
Tapao-NonSen Nov 5, 2025
c0aa141
feat: enhance plugin metadata extraction and initialization process
Tapao-NonSen Nov 5, 2025
c4323e9
feat: add plugin metadata for audio-cache, example, and prebuffer plu…
Tapao-NonSen Nov 5, 2025
c582967
feat: add audioCache and prebuffer plugin configurations to default s…
Tapao-NonSen Nov 5, 2025
cdfe348
feat: update plugin documentation with metadata and example enhancements
Tapao-NonSen Nov 5, 2025
ffc7115
feat: add integration tests for example and audio-cache plugins
Tapao-NonSen Nov 5, 2025
5bbebdb
Update config import to use default file
Tapao-NonSen Nov 5, 2025
3728ab9
Disable audioCache and prebuffer plugins
Tapao-NonSen Nov 5, 2025
0cbaae3
feat: update configuration loading and refine .gitignore entries
Tapao-NonSen Nov 5, 2025
f44a526
Merge branch 'PRs' of https://github.com/Tapao-NonSen/NodeLink into PRs
Tapao-NonSen Nov 5, 2025
3694649
Merge branch 'PerformanC:v3' into PRs
Tapao-NonSen Nov 5, 2025
fd0e4a8
refactor: simplify source manager logic and streamline plugin retrieval
Tapao-NonSen Nov 5, 2025
6d2e679
Merge branch 'PRs' of https://github.com/Tapao-NonSen/NodeLink into PRs
Tapao-NonSen Nov 5, 2025
057f0a2
fix: update plugin retrieval method in API response
Tapao-NonSen Nov 5, 2025
8974e58
feat: enhance audio cache plugin settings with maxSize and protection…
Tapao-NonSen Nov 5, 2025
7043b80
refactor: rename variable for clarity in plugin handler function
Tapao-NonSen Nov 5, 2025
44240ce
refactor: improve code clarity and consistency in PluginManager class
Tapao-NonSen Nov 5, 2025
565eadb
refactor: rename functions and variables for improved clarity in audi…
Tapao-NonSen Nov 5, 2025
03b8363
docs: update plugin documentation with prebuffer settings and naming …
Tapao-NonSen Nov 5, 2025
8a29359
Merge branch 'PerformanC:v3' into PRs
Tapao-NonSen Nov 5, 2025
e34ca7d
docs: restructure and enhance NodeLink plugin documentation for clari…
Tapao-NonSen Nov 5, 2025
403f220
Merge branch 'PRs' of https://github.com/Tapao-NonSen/NodeLink into PRs
Tapao-NonSen Nov 5, 2025
d162d39
docs: expand and reorganize plugin documentation for improved clarity…
Tapao-NonSen Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
!docs/**
!src
!src/**
!test/
!test/**
!.dockerignore
!.gitignore
!constants.js
Expand All @@ -14,4 +16,6 @@
!package.json
!README.md
!config.default.js
!biome.json
!biome.json
!test
!test/**
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,45 @@ Once started, NodeLink runs a Lavalink-compatible WebSocket server, ready for im

---

## Plugins
NodeLink now supports a simple plugin system so you can add custom HTTP routes and register new sources or lyrics providers without modifying core files.

- Local development: add files under `src/plugins/src/*.js`.
- Package plugins: install NPM packages named `nodelink-plugin-*`.

See `docs/plugins.md` for the full API and examples. Prefer descriptive names over abbreviations in plugins (e.g., `pluginApi`, `configuration`).

### Audio Cache Plugin Settings
- Configure in `config.js` under `plugins.audioCache`:
```js
plugins: {
audioCache: {
enabled: true,
dir: 'cache/audio', // cache directory
ttlDays: 7, // days to keep inactive files
cleanupIntervalHours: 12, // periodic cleanup interval
maxSize: '1GB', // or maxSizeBytes: 10 * 1024 * 1024 * 1024
protectRecentMinutes: 60, // Do not evict files accessed within this window (minutes)
allowExceedWhenAllRecent: true // If all files are in-use or recently used, allow exceeding max size
}
}
```

### Prebuffer Plugin Settings
- Configure in `config.js` under `plugins.prebuffer`:
```js
plugins: {
prebuffer: {
enabled: true,
bytes: '512 KB', // target initial buffered bytes
timeoutMs: 2000, // optional maximum wait for prebuffer
highWaterMark: '1 MB' // internal stream buffer size
}
}
```

---

## Usage

NodeLink is compatible with most Lavalink clients, as it implements nearly the entire original API.
Expand Down
24 changes: 24 additions & 0 deletions config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,29 @@ export default {
delayMs: 500,
blockDurationMs: 300000 // 5 minutes
}
},
plugins: {
audioCache: {
enabled: false,
dir: 'cache/audio',
ttlDays: 7,
cleanupIntervalHours: 12,
maxSize: '1GB', // or maxSizeBytes: 10 * 1024 * 1024 * 1024
// Do not evict files accessed within this window (minutes)
protectRecentMinutes: 60,
// If all files are in-use or recently used, allow exceeding max size
allowExceedWhenAllRecent: true
},
// Start playback only after some data has buffered.
// Applies to non-live streams. Uses compressed bytes (source stream) as reference.
prebuffer: {
enabled: false,
// Buffer target before releasing data downstream. Accepts number (bytes) or string: '512KB', '1MB', etc.
bytes: '512KB',
// Max time to wait before starting even if bytes not reached (ms). Set 0 to disable.
timeoutMs: 2000,
// Internal stream highWaterMark for the output wrapper
highWaterMark: '1MB'
}
}
}
7 changes: 7 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,10 @@ A dynamic range compressor that reduces the volume of loud sounds or amplifies q
| attack? | float | The attack time in milliseconds. |
| release? | float | The release time in milliseconds. |
| gain? | float | The makeup gain in dB. |


### Cache Plugin Endpoints

- GET /v4/cache/stats: Returns cache file count, total bytes, optional maxBytes, and usagePercent if a cap is configured.
- POST /v4/cache/cleanup: Triggers TTL cleanup immediately.

Loading