How Meting's Provider architecture works
masterMeting uses a Provider pattern to isolate the logic for different music platforms. Instead of a single monolithic file, each platform (e.g., NetEase, Tencent, Baidu) has its own dedicated Provider class that inherits from a common base.
- The
Metingclass acts as a coordinator (orchestrator). It provides a unified API to the user and delegates all platform-specific execution logic to the active Provider. - The
ProviderFactorymanages the creation and lifecycle of these providers. - The
BaseProviderdefines the standard interface that all platform providers must implement to ensure compatibility with the mainMetingclass.
import Meting from './src/meting.js';
// The Meting instance delegates calls to the underlying provider
const meting = new Meting('netease');
const result = await meting.search('稻香');