@backendsuraj/offline-ffprobe 8.0.0 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,7 +37,7 @@ fluentFfmpeg('input.mp4').ffprobe((err, data) => {
37
37
  ## Binary Details
38
38
  - **Source**: [BtbN/FFmpeg-Builds](https://github.com/BtbN/FFmpeg-Builds/releases)
39
39
  - **Version**: 8.0.0
40
- - **License**: LGPL 3.0
40
+ - **License**: GPL 3.0
41
41
 
42
42
  ## Supported Platforms
43
43
  | OS | Architecture | Status |
package/index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The absolute path to the ffprobe executable.
3
+ */
4
+ export const path: string;
5
+
6
+ /**
7
+ * The version of the ffprobe binary.
8
+ */
9
+ export const version: string;
package/index.js CHANGED
@@ -1,34 +1,33 @@
1
1
  var os = require('os');
2
2
  var path = require('path');
3
+ var fs = require('fs');
3
4
 
4
5
  var platform = os.platform();
5
6
  var arch = os.arch();
6
7
 
7
- if (platform !== 'linux' && platform !== 'darwin' && platform !== 'win32') {
8
+ if (platform === 'darwin') {
9
+ console.error('MacOS support coming soon.');
10
+ process.exit(1);
11
+ }
12
+
13
+ if (platform !== 'linux' && platform !== 'win32') {
8
14
  console.error('Unsupported platform: ' + platform);
9
- console.error('ffprobe-installer only supports linux, darwin and win32 systems');
15
+ console.error('offline-ffprobe only supports linux and win32 systems');
10
16
  process.exit(1);
11
17
  }
12
18
 
13
- var ffprobePath = path.join(
14
- __dirname,
15
- 'node_modules',
16
- '@backendsuraj',
17
- 'offline-ffprobe-' + platform + '-' + arch,
18
- 'bin',
19
- platform === 'win32' ? 'ffprobe.exe' : 'ffprobe'
20
- );
19
+ var packageName = 'offline-ffprobe-' + platform + '-' + arch;
20
+ var binaryName = platform === 'win32' ? 'ffprobe.exe' : 'ffprobe';
21
+
22
+ var ffprobePath = path.resolve(__dirname, 'node_modules', '@backendsuraj', packageName, 'bin', binaryName);
23
+
24
+ if (!fs.existsSync(ffprobePath)) {
25
+ ffprobePath = path.resolve(__dirname, '..', packageName, 'bin', binaryName);
26
+ }
21
27
 
22
- var fs = require('fs');
23
28
  if (!fs.existsSync(ffprobePath)) {
24
- ffprobePath = path.join(
25
- __dirname,
26
- '..',
27
- 'offline-ffprobe-' + platform + '-' + arch,
28
- 'bin',
29
- platform === 'win32' ? 'ffprobe.exe' : 'ffprobe'
30
- );
29
+ ffprobePath = path.resolve(__dirname, '..', '..', packageName, 'bin', binaryName);
31
30
  }
32
31
 
33
32
  exports.path = ffprobePath;
34
- exports.version = '8.0.0';
33
+ exports.version = '8.0.2';
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "@backendsuraj/offline-ffprobe",
3
- "version": "8.0.0",
3
+ "version": "8.0.2",
4
4
  "description": "Platform independent binary installer of FFprobe for node projects (Offline Friendly)",
5
5
  "main": "index.js",
6
+ "types": "index.d.ts",
6
7
  "author": "Suraj",
7
- "license": "LGPL-3.0",
8
+ "license": "GPL-3.0",
8
9
  "repository": {
9
10
  "type": "git",
10
11
  "url": "https://github.com/backendsuraj/offline-ffmpeg"
11
12
  },
12
13
  "optionalDependencies": {
13
- "@backendsuraj/offline-ffprobe-win32-x64": "8.0.0",
14
- "@backendsuraj/offline-ffprobe-linux-x64": "8.0.0"
14
+ "@backendsuraj/offline-ffprobe-win32-x64": "8.0.2",
15
+ "@backendsuraj/offline-ffprobe-linux-x64": "8.0.2"
15
16
  }
16
17
  }