brew install ffmpeg
Run the script with the input media file as a command-line argument. The script will check for chapters and convert them into individual MP3 files. If no chapters are found, the entire file will be converted into a single MP3 file.
node index.js path/to/your/file.m4b