For instance, if you were to run a Python script you would type python filename.py or if you wanted to run a C program make filename then ./ filename>
You can use a shebang file :
script.js
#!/usr/bin/env node console.log('Hello terminal');
And run it
./script.js
Don't forget to chmod +x script.js
chmod +x script.js