mediasnacks 0.18.1 → 0.18.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
@@ -6,13 +6,20 @@ Utilities video and images.
6
6
  ### Install
7
7
  **FFmpeg and Node.js must be installed.**
8
8
 
9
- ```shell
10
- npm install -g mediasnacks --ignore-scripts=true
9
+ ```sh
10
+ npm install -g mediasnacks
11
+ ```
12
+
13
+ Optionally, if you have `ignore-scripts=true` in your `.npmprc`,
14
+ you can install zsh auto-completions with:
15
+ ```sh
16
+ $(npm root -g)/mediasnacks/install-zsh-completions.sh
11
17
  ```
12
18
 
13
19
 
20
+
14
21
  ## Overview
15
- ```shell
22
+ ```sh
16
23
  mediasnacks <command> <args>
17
24
  ```
18
25
 
@@ -4,9 +4,6 @@ set -eu
4
4
  # Exit on systems without ZSH
5
5
  zsh=$(command -v zsh) || exit 0
6
6
 
7
- # Exit on non-global (npm -g) installations
8
- [ "${npm_config_global:-}" = "true" ] || exit 0
9
-
10
7
  src="$(cd "$(dirname "$0")" && pwd)/.zsh/completions/_mediasnacks"
11
8
  [ -f "$src" ] || exit 0
12
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasnacks",
3
- "version": "0.18.1",
3
+ "version": "0.18.2",
4
4
  "description": "Utilities for optimizing and preparing videos and images",
5
5
  "license": "MIT",
6
6
  "author": "Eric Fortis",
@@ -10,7 +10,8 @@
10
10
  },
11
11
  "scripts": {
12
12
  "test": "docker run --rm $(docker build -q .)",
13
- "postinstall": "sh install-zsh-completions.sh"
13
+ "postinstall": "sh install-zsh-completions.sh",
14
+ "dev-install": "npm i -g . --ignore-scripts=false"
14
15
  },
15
16
  "files": [
16
17
  "src",
package/src/avif.js CHANGED
@@ -29,7 +29,7 @@ async function main() {
29
29
  }
30
30
 
31
31
  if (!files.length)
32
- throw new Error('No images specified. See npx mediasnacks avif --help')
32
+ throw new Error('No images specified. See mediasnacks avif --help')
33
33
 
34
34
  console.log('AVIF…')
35
35
  for (const file of files)
package/src/cli.js CHANGED
@@ -62,7 +62,7 @@ if (!opt) {
62
62
  process.exit(1)
63
63
  }
64
64
  if (!Object.hasOwn(COMMANDS, opt)) {
65
- console.error(`'${opt}' is not a command. See npx mediasnacks --help\n`)
65
+ console.error(`'${opt}' is not a command. See mediasnacks --help\n`)
66
66
  process.exit(1)
67
67
  }
68
68
 
package/src/dropdups.js CHANGED
@@ -45,7 +45,7 @@ async function main() {
45
45
  }
46
46
 
47
47
  if (!files.length)
48
- throw new Error('No video specified. See npx mediasnacks dropdups --help')
48
+ throw new Error('No video specified. See mediasnacks dropdups --help')
49
49
 
50
50
  let nBadFrame = values['bad-frame-number']
51
51
  if (nBadFrame && !/^\d+$/.test(nBadFrame))
package/src/edgespic.js CHANGED
@@ -14,8 +14,8 @@ Extracts the first and last frames from each video and saves them to the 'edgepi
14
14
  --width defaults to 640px and The aspect ratio is preserved.
15
15
 
16
16
  Example:
17
- npx mediasnacks edgespic --width 800 *.mov
18
- npx mediasnacks edgespic -w 600 'videos/**/*.mp4'
17
+ mediasnacks edgespic --width 800 *.mov
18
+ mediasnacks edgespic -w 600 'videos/**/*.mp4'
19
19
  `.trim()
20
20
 
21
21
 
package/src/prores.js CHANGED
@@ -27,8 +27,8 @@ Options:
27
27
  -h, --help Show this help message
28
28
 
29
29
  Example:
30
- npx mediasnacks prores video.mov
31
- npx mediasnacks prores --profile 2 video.mov
30
+ mediasnacks prores video.mov
31
+ mediasnacks prores --profile 2 video.mov
32
32
 
33
33
  Outputs: video.prores.mov
34
34
  `.trim()
@@ -48,7 +48,7 @@ async function main() {
48
48
  }
49
49
 
50
50
  if (files.length !== 1)
51
- throw new Error('Expected 1 argument: video file. See npx mediasnacks prores --help')
51
+ throw new Error('Expected 1 argument: video file. See mediasnacks prores --help')
52
52
 
53
53
  const videoPath = resolve(files[0])
54
54
 
package/src/resize.js CHANGED
@@ -15,10 +15,10 @@ Usage: mediasnacks resize [--width=<num>] [--height=<num>] [-y | --overwrite] [-
15
15
  Resizes videos and images. The aspect ratio is preserved when only one dimension is specified.
16
16
 
17
17
  Example: Overwrites the input file (-y)
18
- npx mediasnacks resize -y --width 480 'dir-a/**/*.png' 'dir-b/**/*.mp4'
18
+ mediasnacks resize -y --width 480 'dir-a/**/*.png' 'dir-b/**/*.mp4'
19
19
 
20
20
  Example: Output directory (-o)
21
- npx mediasnacks resize --height 240 --output-dir /tmp/out video.mov
21
+ mediasnacks resize --height 240 --output-dir /tmp/out video.mov
22
22
 
23
23
  Details:
24
24
  --width and --height are -2 by default:
package/src/sqcrop.js CHANGED
@@ -30,7 +30,7 @@ async function main() {
30
30
  }
31
31
 
32
32
  if (!files.length)
33
- throw new Error('No images specified. See npx mediasnacks sqcrop --help')
33
+ throw new Error('No images specified. See mediasnacks sqcrop --help')
34
34
 
35
35
  console.log('Cropping…')
36
36
  for (const file of files)
package/src/vsplit.js CHANGED
@@ -19,7 +19,7 @@ Arguments:
19
19
  <video> Video file to split
20
20
 
21
21
  Example:
22
- npx mediasnacks vsplit clips.csv video.mov
22
+ mediasnacks vsplit clips.csv video.mov
23
23
 
24
24
  Given clips.csv:
25
25
  start,end
@@ -44,7 +44,7 @@ async function main() {
44
44
  }
45
45
 
46
46
  if (files.length !== 2)
47
- throw new Error('Expected 2 arguments: CSV file and video file. See npx mediasnacks vsplit --help')
47
+ throw new Error('Expected 2 arguments: CSV file and video file. See mediasnacks vsplit --help')
48
48
 
49
49
  const [csvPath, videoPath] = files.map(f => resolve(f))
50
50
 
package/src/vtrim.js CHANGED
@@ -32,7 +32,7 @@ async function main() {
32
32
  }
33
33
 
34
34
  if (!files.length)
35
- throw new Error('No video specified. See npx mediasnacks vtrim --help')
35
+ throw new Error('No video specified. See mediasnacks vtrim --help')
36
36
 
37
37
  for (const file of files)
38
38
  await trim(resolve(file), values.start, values.end)