Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-pre-commit

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-pre-commit - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

LICENSE.txt

2

cli.js

@@ -20,2 +20,2 @@ #!/usr/bin/env node

console.log('Set pre commit hooK: ' + command)
console.log('Set pre commit hook: ' + command)
{
"name": "simple-pre-commit",
"version": "1.1.0",
"version": "1.1.1",
"description": "A simple, zero dependency tool for setting up git pre-commit hook for small projects",

@@ -11,9 +11,12 @@ "author": "Mikhail Gorbunov <toplenboren@gmail.com> (toplenboren.gituhb.io)",

"lint": "eslint *.js",
"test": "jest"
"test": "jest",
"publish": "clean-publish"
},
"keywords": [],
"keywords": [
"pre-commit",
"git",
"hook",
"lint"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/toplenboren/simple-pre-commit/issues"
},
"homepage": "https://github.com/toplenboren/simple-pre-commit",

@@ -24,2 +27,3 @@ "lint-staged": {

"devDependencies": {
"clean-publish": "^1.1.8",
"eslint": "^7.19.0",

@@ -26,0 +30,0 @@ "jest": "^26.6.3",

# simple-pre-commit
A tool, that let you set any command from `package.json` as a pre-commit hook
A tool, that let you set any command from `package.json` as a pre-commit hook.
## Why?
- Zero dependency

@@ -16,11 +14,17 @@ - Lightweight

`npm install simple-pre-commit --save-dev`
```sh
npm install simple-pre-commit --save-dev
```
2. Add the `simple-pre-commit` to your `package.json`. Feed it with any command you would like to run as a pre-commit hook.
`"simple-pre-commit":"npx lint-staged"`
```json
"simple-pre-commit": "npx lint-staged"`
```
3. Run the CLI script to update the git hook with command from `package.json`
`npx simple-pre-commit`
```sh
npx simple-pre-commit
```

@@ -27,0 +31,0 @@ Now the command from `package.json` is set up as executable git pre-commit hook.

@@ -8,3 +8,3 @@ const fs = require('fs')

* @param {string} directory
* @return {string | undefined} .git folder path or undefined if if was not found
* @return {string | undefined} .git folder path or undefined if it was not found
*/

@@ -11,0 +11,0 @@ function getGitProjectRoot(directory=module.parent.filename) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc