I have accomplished running a js file with the following python script:
import subprocess
subprocess.check_call('npm run test')
The file test.js reads sensor data and is only written in javascript because the only available library for this sensor is a NodeJS library. Now, I want the test.js to return those values everytime it is executed within my python script. How do I do that?
And it is not possible via this method, are there others? I cannot write this js script in python as the library uses NodeJS. 
I want to thank everone that tries to help me in advance and if you need more info, simply contact me!
For anyone who might ever find himself in the same situation, I have found a workaround that works for me and might even work for you!
So, this is actually quite simple, but only works for a specific application. Here, I have a sensor which is read by a javascript script, but I want a python script to handle the sensor's output value. What I did was:
import subprocess
import os 
deadly_string = subprocess.getoutput('npm run test')
not_so_deadly_string = deadly_string[-6:]
print ("value: ", not_so_deadly_string)
I captured the output of the terminal with "subprocess.getoutput". The output of the terminal looks something like this:
nodejs-qmc5883l@....
.....
Declination angle correction: 1
.
.
.
Azimuth= 300.00
The value "300.00" is what I want, so I cut the last 5 characters of the string and that's it....
Running a javascript script through python using the subprocess library on a raspberry pi and returning values from it