├── .gitignore
├── .npmignore
├── README.md
├── forWindows.vbs
├── illuminati.jpg
├── index.js
├── package.json
├── xfiles.mp3
└── xfiles.ogg
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | illuminati.jpg
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # X-Files Command Line Sound
2 |
3 |
4 |

5 |
6 |
7 | > Dan dan dan daaaaaaannnn!
8 |
9 | Play famous "X-Files" sound.
10 |
11 | ## Compatibility
12 |
13 | - Linux
14 | - Windows
15 | - Mac
16 |
17 | ## Installing
18 | Install globally:
19 |
20 | npm install -g xfilescl
21 |
22 | ## Running
23 | Run command:
24 |
25 | xfiles
26 |
27 | Or import in NodeJS script:
28 |
29 | import xfiles from 'xfilescl';
30 |
31 | xfiles();
32 |
33 | ## See also
34 |
35 | - [Faustão Errou](https://github.com/BrOrlandi/faustao-errou/)
--------------------------------------------------------------------------------
/forWindows.vbs:
--------------------------------------------------------------------------------
1 | Dim oPlayer
2 | Set oPlayer = CreateObject("WMPlayer.OCX")
3 |
4 | ' Play audio
5 | oPlayer.URL = WScript.Arguments(0)
6 | oPlayer.controls.play
7 | While oPlayer.playState <> 1 ' 1 = Stopped
8 | WScript.Sleep 100
9 | Wend
10 |
11 | ' Release the audio file
12 | oPlayer.close
13 |
--------------------------------------------------------------------------------
/illuminati.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BrOrlandi/xfiles/25d030a4645b429a3822625376abb9354f9fc96e/illuminati.jpg
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const exect = require('child_process').exec;
4 | const path = require('path');
5 | const fs = require('fs');
6 |
7 | const mainPath = path.dirname(fs.realpathSync(__filename));
8 | const soundPath = path.join(mainPath, './xfiles');
9 |
10 | const xfiles = function (){
11 | const linuxcmd = 'paplay '+soundPath+'.ogg';
12 | const windowscmd = path.join(mainPath, './forWindows.vbs')+' '+soundPath+'.mp3';
13 | const maccmd = 'afplay '+soundPath+'.mp3';
14 |
15 | const platform = process.platform;
16 |
17 | if(platform === 'linux'){
18 | return exec(linuxcmd);
19 | }
20 | else if(platform === 'win32'){
21 | return exec(windowscmd);
22 | } else if(platform === 'darwin'){
23 | return exec(maccmd);
24 | }
25 |
26 | function exec(cmd){
27 | return exect(cmd, function (error, stdout, stderr) {
28 | if(error)
29 | console.error(error);
30 | });
31 | }
32 | }
33 |
34 | module.exports = xfiles;
35 |
36 | if (!module.parent) {
37 | xfiles();
38 | }
39 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "xfilescl",
3 | "version": "1.0.1",
4 | "description": "Dan dan dan daaaaaaannnn!",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+ssh://git@github.com/BrOrlandi/xfiles.git"
12 | },
13 | "author": "Bruno Orlandi ",
14 | "license": "MIT",
15 | "bin": {
16 | "xfiles": "./index.js"
17 | },
18 | "bugs": {
19 | "url": "https://github.com/BrOrlandi/xfiles/issues"
20 | },
21 | "homepage": "https://github.com/BrOrlandi/xfiles#readme"
22 | }
23 |
--------------------------------------------------------------------------------
/xfiles.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BrOrlandi/xfiles/25d030a4645b429a3822625376abb9354f9fc96e/xfiles.mp3
--------------------------------------------------------------------------------
/xfiles.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BrOrlandi/xfiles/25d030a4645b429a3822625376abb9354f9fc96e/xfiles.ogg
--------------------------------------------------------------------------------