Skip to content

Commit 550f53f

Browse files
committed
△△:eyes::bulb::shipit:△△
0 parents  commit 550f53f

9 files changed

+109
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
illuminati.jpg

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# X-Files Command Line Sound
2+
3+
<div style="text-align: center">
4+
<img src="./illuminati.jpg" height="300"/>
5+
</div>
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 xfiles
21+
22+
## Running
23+
Run command:
24+
25+
xfiles
26+
27+
Or import in NodeJS script:
28+
29+
import xfiles from 'xfiles';
30+
31+
xfiles();
32+
33+
## See also
34+
35+
- [Faustão Errou](https://github.com/BrOrlandi/faustao-errou/)

forWindows.vbs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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

illuminati.jpg

92 KB
Loading

index.js

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
}

package.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "xfiles",
3+
"version": "1.0.0",
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 <brorlandi@gmail.com>",
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+
}

xfiles.mp3

1.01 MB
Binary file not shown.

xfiles.ogg

1.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)