From 206fb5406c13b3b7384586c83cca00b690a154ad Mon Sep 17 00:00:00 2001 From: Romain Date: Sun, 10 Dec 2023 10:09:24 +0000 Subject: [PATCH] chore: use node: prefix for all builtin modules --- lib/image/gifsicle.js | 2 +- lib/image/heic.js | 4 ++-- lib/index.js | 4 ++-- lib/video/ffargs.js | 2 +- lib/video/ffmpeg.js | 2 +- lib/video/ffprobe.js | 2 +- test/clean.js | 2 +- test/integration/diff.js | 2 +- test/integration/video.test.js | 2 +- test/unit/ffmpeg.test.js | 2 +- test/unit/ffprobe.test.js | 2 +- test/unit/gifsicle.test.js | 2 +- test/unit/gmagick.test.js | 2 +- test/unit/heic.test.js | 2 +- 14 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/image/gifsicle.js b/lib/image/gifsicle.js index 46724ad..898de11 100644 --- a/lib/image/gifsicle.js +++ b/lib/image/gifsicle.js @@ -1,4 +1,4 @@ -const childProcess = require('child_process') +const childProcess = require('node:child_process') const trace = require('debug')('thumbsup:trace') const GIF_FILE = /\.gif$/i diff --git a/lib/image/heic.js b/lib/image/heic.js index 4c3dd63..ece817e 100644 --- a/lib/image/heic.js +++ b/lib/image/heic.js @@ -1,6 +1,6 @@ +const childProcess = require('node:child_process') +const path = require('node:path') const async = require('async') -const childProcess = require('child_process') -const path = require('path') const tmp = require('tmp') const trace = require('debug')('thumbsup:trace') diff --git a/lib/index.js b/lib/index.js index 68de2c5..64cd3ba 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,6 +1,6 @@ +const fs = require('node:fs') +const path = require('node:path') const async = require('async') -const fs = require('fs') -const path = require('path') const gifsicle = require('./image/gifsicle') const gmagick = require('./image/gmagick') const heic = require('./image/heic') diff --git a/lib/video/ffargs.js b/lib/video/ffargs.js index 10f73f4..e9b2090 100644 --- a/lib/video/ffargs.js +++ b/lib/video/ffargs.js @@ -1,4 +1,4 @@ -const path = require('path') +const path = require('node:path') const DEFAULT_AUDIO_BITRATE = '96k' const DEFAULT_VIDEO_FPS = 25 diff --git a/lib/video/ffmpeg.js b/lib/video/ffmpeg.js index de6b907..130fddc 100644 --- a/lib/video/ffmpeg.js +++ b/lib/video/ffmpeg.js @@ -1,4 +1,4 @@ -const childProcess = require('child_process') +const childProcess = require('node:child_process') const trace = require('debug')('thumbsup:trace') const debug = require('debug')('thumbsup:debug') const EventEmitter = require('events') diff --git a/lib/video/ffprobe.js b/lib/video/ffprobe.js index 07134fb..ae49806 100644 --- a/lib/video/ffprobe.js +++ b/lib/video/ffprobe.js @@ -1,4 +1,4 @@ -const childProcess = require('child_process') +const childProcess = require('node:child_process') const trace = require('debug')('thumbsup:trace') exports.getDuration = function (src, callback) { diff --git a/test/clean.js b/test/clean.js index 5b22577..40ee8ee 100644 --- a/test/clean.js +++ b/test/clean.js @@ -1,5 +1,5 @@ +const path = require('node:path') const fs = require('fs-extra') -const path = require('path') module.exports = async () => { // Clean up test data before the tests run diff --git a/test/integration/diff.js b/test/integration/diff.js index 6b71260..1d35668 100644 --- a/test/integration/diff.js +++ b/test/integration/diff.js @@ -1,6 +1,6 @@ +const childProcess = require('node:child_process') const _ = require('lodash') const should = require('should/as-function') -const childProcess = require('child_process') const gm = require('gm') const convert = require('../../lib/index') diff --git a/test/integration/video.test.js b/test/integration/video.test.js index a7cbe9d..51e1b04 100644 --- a/test/integration/video.test.js +++ b/test/integration/video.test.js @@ -1,5 +1,5 @@ +const assert = require('node:assert') const should = require('should/as-function') -const assert = require('assert') const diff = require('./diff') const convert = require('../../lib/index') diff --git a/test/unit/ffmpeg.test.js b/test/unit/ffmpeg.test.js index e1e3c47..cd8f7de 100755 --- a/test/unit/ffmpeg.test.js +++ b/test/unit/ffmpeg.test.js @@ -1,5 +1,5 @@ +const childProcess = require('node:child_process') const should = require('should/as-function') -const childProcess = require('child_process') const ffmpeg = require('../../lib/video/ffmpeg') const mockSpawn = require('mock-spawn') const sinon = require('sinon') diff --git a/test/unit/ffprobe.test.js b/test/unit/ffprobe.test.js index 5cad128..e69763a 100644 --- a/test/unit/ffprobe.test.js +++ b/test/unit/ffprobe.test.js @@ -1,6 +1,6 @@ +const childProcess = require('node:child_process') const should = require('should/as-function') const sinon = require('sinon') -const childProcess = require('child_process') const ffprobe = require('../../lib/video/ffprobe') afterEach(() => { diff --git a/test/unit/gifsicle.test.js b/test/unit/gifsicle.test.js index 93892d5..bb95734 100644 --- a/test/unit/gifsicle.test.js +++ b/test/unit/gifsicle.test.js @@ -1,5 +1,5 @@ +const childProcess = require('node:child_process') const should = require('should/as-function') -const childProcess = require('child_process') const sinon = require('sinon') const gifsicle = require('../../lib/image/gifsicle') diff --git a/test/unit/gmagick.test.js b/test/unit/gmagick.test.js index a872f5a..7c5af8e 100644 --- a/test/unit/gmagick.test.js +++ b/test/unit/gmagick.test.js @@ -1,6 +1,6 @@ const should = require('should/as-function') -const gmagick = require('../../lib/image/gmagick') const sinon = require('sinon') +const gmagick = require('../../lib/image/gmagick') function gm () { return { diff --git a/test/unit/heic.test.js b/test/unit/heic.test.js index f1768ca..61aac27 100644 --- a/test/unit/heic.test.js +++ b/test/unit/heic.test.js @@ -1,5 +1,5 @@ +const childProcess = require('node:child_process') const should = require('should/as-function') -const childProcess = require('child_process') const async = require('async') const sinon = require('sinon') const heic = require('../../lib/image/heic')