From 6f24b458bbe797489fde9643c7e884124be27dd1 Mon Sep 17 00:00:00 2001 From: DevAndromeda <46562212+DevAndromeda@users.noreply.github.com> Date: Wed, 26 Jan 2022 01:14:20 +0545 Subject: [PATCH] chore: subpath exports --- README.md | 14 ++++++++++++++ package.json | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf02798..558e020 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,20 @@ These bots are made by the community, they can help you build your own! ## Advanced +### Smooth Volume + +Discord Player will make volume transition smooth. To enable this, you need to add this line at the top of your main file: + +```js +// CJS +require("discord-player/smoothVolume"); + +// ESM +import "discord-player/smoothVolume" +``` + +> ⚠️ Make sure that line is situated at the **TOP** of your **main** file. + ### Use cookies ```js diff --git a/package.json b/package.json index 0ec0f5b..6c44de0 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,11 @@ ], "module": "dist/index.mjs", "exports": { - "require": "./dist/index.js", - "import": "./dist/index.mjs" + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs" + }, + "./smoothVolume": "./dist/smoothVolume.js" }, "scripts": { "dev": "cd example/test && ts-node index.ts",