@w3vish/ffmpeg-installer
Advanced tools
+1
-1
| { | ||
| "name": "@w3vish/ffmpeg-installer", | ||
| "version": "2.0.0", | ||
| "version": "2.0.1", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "description": "A fast and lightweight cross-platform FFmpeg & FFprobe binary installer for Node.js, supporting Linux, macOS, and Windows.", |
+32
-23
@@ -34,10 +34,10 @@ # @w3vish/ffmpeg-installer | ||
| // Import the package | ||
| import ffmpeg from '@w3vish/ffmpeg-installer'; | ||
| // Or import specific paths | ||
| import { ffmpegPath, ffprobePath } from '@w3vish/ffmpeg-installer'; | ||
| import FFmpegInstaller from '@w3vish/ffmpeg-installer'; | ||
| // Access paths | ||
| console.log('FFmpeg path:', ffmpegPath); | ||
| console.log('FFprobe path:', ffprobePath); | ||
| console.log('FFmpeg version:', ffmpeg.version); | ||
| // Access the data directly | ||
| console.log('FFmpeg path:', FFmpegInstaller.ffmpeg.path); | ||
| console.log('FFprobe path:', FFmpegInstaller.ffprobe.path); | ||
| console.log('FFmpeg version:', FFmpegInstaller.ffmpeg.version); | ||
| console.log('Platform:', FFmpegInstaller.platform); | ||
| console.log('Architecture:', FFmpegInstaller.arch); | ||
| ``` | ||
@@ -49,5 +49,5 @@ | ||
| import { spawn } from 'child_process'; | ||
| import { ffmpegPath } from '@w3vish/ffmpeg-installer'; | ||
| import FFmpegInstaller from '@w3vish/ffmpeg-installer'; | ||
| const process = spawn(ffmpegPath, [ | ||
| const process = spawn(FFmpegInstaller.ffmpeg.path, [ | ||
| '-i', 'input.mp4', | ||
@@ -67,7 +67,7 @@ '-c:v', 'libx264', | ||
| import ffmpeg from 'fluent-ffmpeg'; | ||
| import { ffmpegPath, ffprobePath } from '@w3vish/ffmpeg-installer'; | ||
| import FFmpegInstaller from '@w3vish/ffmpeg-installer'; | ||
| // Set paths | ||
| ffmpeg.setFfmpegPath(ffmpegPath); | ||
| ffmpeg.setFfprobePath(ffprobePath); | ||
| ffmpeg.setFfmpegPath(FFmpegInstaller.ffmpeg.path); | ||
| ffmpeg.setFfprobePath(FFmpegInstaller.ffprobe.path); | ||
@@ -102,17 +102,26 @@ // Use fluent-ffmpeg | ||
| ## API | ||
| ## Return Object Structure | ||
| | Property | Type | Description | | ||
| |----------|------|-------------| | ||
| | `path` | `string` | Path to the FFmpeg binary (alias for `ffmpegPath`) | | ||
| | `ffmpegPath` | `string` | Path to the FFmpeg binary | | ||
| | `ffprobePath` | `string` | Path to the FFprobe binary | | ||
| | `version` | `string` | Version of the FFmpeg binaries | | ||
| | `url` | `string` | URL from where the binaries were downloaded | | ||
| | `platform` | `string` | Current platform identifier | | ||
| | `arch` | `string` | Current architecture identifier | | ||
| The package exports an `FFmpegInstaller` object with this structure: | ||
| ```javascript | ||
| { | ||
| ffmpeg: { | ||
| path: '/path/to/ffmpeg', | ||
| version: 'v1.0.0', | ||
| url: 'https://github.com/w3vish/ffmpeg-installer/releases/download/v1.0.0/linux-x64-ffmpeg' | ||
| }, | ||
| ffprobe: { | ||
| path: '/path/to/ffprobe', | ||
| version: 'v1.0.0', | ||
| url: 'https://github.com/w3vish/ffmpeg-installer/releases/download/v1.0.0/linux-x64-ffprobe' | ||
| }, | ||
| platform: 'linux', | ||
| arch: 'x64' | ||
| } | ||
| ``` | ||
| ## TypeScript Types | ||
| The package includes comprehensive TypeScript definitions: | ||
| The package includes TypeScript definitions: | ||
@@ -119,0 +128,0 @@ ```typescript |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
43583
0.21%162
5.88%