diff --git a/docs/guides/usage.md b/docs/guides/usage.md index 9b38fb7..42894a5 100644 --- a/docs/guides/usage.md +++ b/docs/guides/usage.md @@ -10,3 +10,10 @@ ytmusic.initialize().then(() => { // Use API here }) ``` + +In an async context, you can initialize the API in one line + +```ts +const ytmusic = await new YTMusic().initalize() +// Use API here +``` diff --git a/src/YTMusic.ts b/src/YTMusic.ts index 34c137a..35dba43 100644 --- a/src/YTMusic.ts +++ b/src/YTMusic.ts @@ -104,6 +104,8 @@ export default class YTMusic { ...config } } + + return this } /**