eslint-precommit
Advanced tools
| #!/usr/bin/env node | ||
| var fs = require('fs'); | ||
| var cwd = process.cwd(); | ||
| var path = require('path'); | ||
| var os = require('os'); | ||
| fs.stat(path.join(cwd, '.git'), function(err) { | ||
| if (err) { | ||
| return process.exit(0); | ||
| } | ||
| if (os.platform === 'win32') { | ||
| fs.writeFileSync(path.join(cwd, '.git', 'hooks', 'pre-commit.cmd'), | ||
| fs.readFileSync(path.join(__dirname, 'scripts', 'win.cmd'))); | ||
| } else { | ||
| var filePath = path.join(cwd, '.git', 'hooks', 'pre-commit'); | ||
| fs.writeFileSync(filePath, | ||
| fs.readFileSync(path.join(__dirname, 'scripts', 'posix.sh'))); | ||
| fs.chmodSync(filePath, '0755'); | ||
| } | ||
| }); |
+5
-2
| { | ||
| "name": "eslint-precommit", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "eslint pre commit", | ||
| "main": "index.js", | ||
| "bin": { | ||
| "eslint-precommit": "bin/install.js" | ||
| }, | ||
| "scripts": { | ||
| "preinstall": "node index.js", | ||
| "postinstall": "node_modules/.bin/eslint-precommit", | ||
| "test": "echo \"Error: no test specified\" && exit 1" | ||
@@ -9,0 +12,0 @@ }, |
-22
| /** | ||
| * Created by fed on 16/8/8. | ||
| */ | ||
| var fs = require('fs'); | ||
| var cwd = process.cwd(); | ||
| var path = require('path'); | ||
| var os = require('os'); | ||
| fs.stat(path.join(cwd, '.git'), function(err) { | ||
| if (err) { | ||
| return process.exit(0); | ||
| } | ||
| if (os.platform === 'win32') { | ||
| fs.writeFileSync(path.join(cwd, '.git', 'hooks', 'pre-commit.cmd'), | ||
| fs.readFileSync(path.join(__dirname, 'scripts', 'win.cmd'))); | ||
| } else { | ||
| var filePath = path.join(cwd, '.git', 'hooks', 'pre-commit'); | ||
| fs.writeFileSync(filePath, | ||
| fs.readFileSync(path.join(__dirname, 'scripts', 'posix.sh'))); | ||
| fs.chmodSync(filePath, '0755'); | ||
| } | ||
| }); |
Install scripts
Supply chain riskInstall scripts are run when the package is installed or built. Malicious packages often use scripts that run automatically to execute payloads or fetch additional code.
AI-detected potential malware
Supply chain riskAI has identified this package as malware. This is a strong signal that the package may be malicious.
Install scripts
Supply chain riskInstall scripts are run when the package is installed or built. Malicious packages often use scripts that run automatically to execute payloads or fetch additional code.
36466
0.17%1
-50%19
-9.52%