src/spotifyAppleScriptApi.js
function promiseWrapper (resolve, reject) {
            // Wait for the process to exit
            process.on ("exit", (code) => {
                // Did the process crash?
                if (code !== 0) reject (process.stderr.textContent);

                // Resolve
                resolve (process.stdout.textContent);
            });

            // Pipe the script into stdin and end
            process.stdin.write (script);
            process.stdin.end ();
        }
function promiseWrapper (resolve, reject) {
            // Wait for the process to exit
            process.on ("exit", (code) => {
                // Did the process crash?
                if (code !== 0) reject (process.stderr.textContent);

                // Resolve
                resolve (process.stdout.textContent);
            });

            // Pipe the script into stdin and end
            process.stdin.write (script);
            process.stdin.end ();
        }
function promiseWrapper ( resolve , reject ) { // Wait for the process to exit process . on ( "exit" , ( code ) => { // Did the process crash? if ( code !== 0 ) reject ( process . stderr . textContent ) ; // Resolve resolve ( process . stdout . textContent ) ; } ) ; // Pipe the script into stdin and end process . stdin . write ( script ) ; process . stdin . end ( ) ; }
Wrapper for the Promise
Wrapper for the Promise