diff --git a/.github/workflows/npmAudit.yml b/.github/workflows/npmAudit.yml new file mode 100644 index 0000000..6bf7e8a --- /dev/null +++ b/.github/workflows/npmAudit.yml @@ -0,0 +1,45 @@ +name: NPM Audit + +on: + pull_request: + workflow_dispatch: + push: + branches: + - master + +jobs: + scan: + name: NPM Audit packages + runs-on: ubuntu-latest + permissions: + contents: read + issues: write + pull-requests: write + + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@v5 + with: + node-version: ${{ vars.NODE_VERSION }} + + - name: Install dependencies + run: npm i + env: + NODE_ENV: production + CI: true + - uses: oke-py/npm-audit-action@3fa1b7654e7ff98cbb75c17f927c076a22991572 # v3.0.0 + with: + audit_level: moderate + create_issues: true + create_pr_comments: true + github_token: ${{ secrets.GITHUB_TOKEN }} + issue_assignees: oke-py + issue_labels: vulnerability,test + dedupe_issues: true + json_flag: true diff --git a/.github/workflows/node.js.yml b/.github/workflows/unitTest.yml similarity index 75% rename from .github/workflows/node.js.yml rename to .github/workflows/unitTest.yml index 81f7b37..628a087 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/unitTest.yml @@ -1,7 +1,7 @@ # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Node.js CI +name: Unit Test on: push: @@ -11,6 +11,7 @@ on: jobs: build: + name: Unit Test runs-on: ${{ matrix.os }} env: @@ -19,19 +20,19 @@ jobs: strategy: matrix: os: [windows-latest, ubuntu-latest] - node-version: [14.x, 16.x, 18.x] + node-version: [22.20.0, 24.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - name: Install GraphicsMagic and Imagemagick on Ubuntu if: contains(matrix.os, 'ubuntu') - run: sudo apt-get install -y imagemagick graphicsmagick + run: sudo apt-get install -y imagemagick=7.1.1-21 graphicsmagick=1.3.35-Q16 ghostscript - name: Install GraphicsMagic and Imagemagick on Windows if: contains(matrix.os, 'windows') - run: choco install -y imagemagick graphicsmagick - - uses: actions/checkout@v3 + run: choco install -y imagemagick --version 7.1.1-21-Q16-HDRI-x64-dll.exe graphicsmagick --version 1.3.35-Q16-win64-dll.exe ghostscript + - uses: actions/checkout@v6.0.2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v5 with: node-version: ${{ matrix.node-version }} - run: npm i diff --git a/.gitignore b/.gitignore index cc06978..4e973d4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .DS_Store node_modules -package-lock.json examples/imgs/* !examples/imgs/original.jpg !examples/imgs/original.png diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..5660f81 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +registry=https://registry.npmjs.org/ \ No newline at end of file diff --git a/lib/command.js b/lib/command.js index 46930cd..32b2ae4 100644 --- a/lib/command.js +++ b/lib/command.js @@ -318,7 +318,7 @@ module.exports = function (proto) { err = new Error('Command failed: ' + stderr); err.code = code; err.signal = signal; - }; + } cb(err, stdout, stderr, cmd); stdout = stderr = onOut = onErr = onExit = null; }); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..f452330 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,132 @@ +{ + "name": "gm", + "version": "2.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "gm", + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "array-parallel": "~0.1.3", + "array-series": "~0.1.5", + "cross-spawn": "^7.0.6", + "debug": "^4.4.3" + }, + "devDependencies": { + "async": "~3.2.6" + }, + "engines": { + "node": ">=22.20.0" + } + }, + "node_modules/array-parallel": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/array-parallel/-/array-parallel-0.1.3.tgz", + "integrity": "sha512-TDPTwSWW5E4oiFiKmz6RGJ/a80Y91GuLgUYuLd49+XBS75tYo8PNgaT2K/OxuQYqkoI852MDGBorg9OcUSTQ8w==", + "license": "MIT" + }, + "node_modules/array-series": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/array-series/-/array-series-0.1.5.tgz", + "integrity": "sha512-L0XlBwfx9QetHOsbLDrE/vh2t018w9462HM3iaFfxRiK83aJjAt/Ja3NMkOW7FICwWTlQBa3ZbL5FKhuQWkDrg==", + "license": "MIT" + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + } + } +} diff --git a/package.json b/package.json index 73c866a..cd6df85 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gm", "description": "GraphicsMagick and ImageMagick for node.js", - "version": "1.25.0", + "version": "2.0.1", "author": "Aaron Heckmann ", "keywords": [ "graphics", @@ -14,8 +14,9 @@ "identify", "compare" ], + "engineStrict": true, "engines": { - "node": ">=14" + "node": ">=22.20.0" }, "bugs": { "url": "http://github.com/aheckmann/gm/issues" @@ -35,16 +36,16 @@ }, "repository": { "type": "git", - "url": "https://github.com/aheckmann/gm.git" + "url": "git+https://github.com/aheckmann/gm.git" }, "license": "MIT", "devDependencies": { - "async": "~0.9.0" + "async": "~3.2.6" }, "dependencies": { "array-parallel": "~0.1.3", "array-series": "~0.1.5", - "cross-spawn": "^4.0.0", - "debug": "^3.1.0" + "cross-spawn": "^7.0.6", + "debug": "^4.4.3" } }