Skip to content

Commit

Permalink
chore: use node native module instead of mkdirp package
Browse files Browse the repository at this point in the history
  • Loading branch information
rprieto committed Nov 26, 2023
1 parent a79bfda commit 3df6aff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const async = require('async')
const fs = require('fs')
const mkdirp = require('mkdirp')
const path = require('path')
const gifsicle = require('./image/gifsicle')
const gmagick = require('./image/gmagick')
Expand All @@ -18,7 +17,7 @@ const DEFAULT_STILL_SEEK_SECONDS = 1
*/
exports.image = function (source, target, options, callback) {
// create target folder if needed
mkdirp.sync(path.dirname(target))
fs.mkdirSync(path.dirname(target), { recursive: true })

// when processing a GIF
// - if asking for an animated target, process with Gifsicle
Expand Down Expand Up @@ -49,7 +48,7 @@ exports.image = function (source, target, options, callback) {

exports.video = function (source, target, options, callback) {
// create target folder if needed
mkdirp.sync(path.dirname(target))
fs.mkdirSync(path.dirname(target), { recursive: true })

// run ffmpeg to create the downsized video
const args = ffargs.prepare(source, target, options)
Expand All @@ -61,7 +60,8 @@ exports.video = function (source, target, options, callback) {
*/
exports.still = function (source, target, options, callback) {
// create target folder if needed
mkdirp.sync(path.dirname(target))
fs.mkdirSync(path.dirname(target), { recursive: true })

async.series([
(next) => extractFrame(source, target, options, next),
(next) => exports.image(target, target, options, next)
Expand Down
15 changes: 0 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"async": "^3.2.4",
"debug": "^4.3.4",
"gm": "^1.25.0",
"mkdirp": "^2.1.5",
"split": "^1.0.1",
"tmp": "^0.2.1"
},
Expand Down

0 comments on commit 3df6aff

Please sign in to comment.