# parstager

> Minimize whitespace diffs when using Parinfer

Latest version **1.0.0** (published 2024-08-04) · 0 weekly downloads

## Install

```sh
npm install parstager
pnpm add parstager
yarn add parstager
bun add parstager
```

Provides the command `parstager`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2024-08-04 |
| First published | 2023-04-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | shaunlebron |

## Links

- npm: https://www.npmjs.com/package/parstager
- npm.io page: https://npm.io/package/parstager

## Dependencies (1)

- [parinfer](https://npm.io/package/parinfer.md) ^3.13.1

## Recent versions

- 1.0.0 (latest) — 2024-08-04
- 0.1.1 — 2023-04-21
- 0.1.0 — 2023-04-20

## README

> **NOTE**: experimental

# Parstager

Quickly undo Parinfer formatting on unchanged top-level forms. (using the original formatting found in git `HEAD`)

Helps you minimize diffs when working on teams that don’t use Parinfer or [Parlinter](https://github.com/parinfer/parlinter).

```
npm install -g parstager
```

```
parstager src               # 1. clean src/ files of some parinfer changes
git add src                 # 2. stage src/
git commit -m 'my changes'  # 3. commit changes
```

## Example

When working on teams that don’t use Parinfer, diffs can be quite large.  Parstager helps me isolate diffs to only the functions which I have changed:

<table>
<thead>
<tr>
<th>Original file</th>
<th>Edited with Parinfer</th>
<th>Cleaned by Parstager</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td>

```clj
(ns user
  (:require
    [clojure.string :as str]
    ))

(defn add-nums
  ([a b]
     (+ a b))
  ([a b c]
     (+ a b c))
  )

(defn add-strs
  ([a b]
     (str a b))
  ([a b c]
     (str a b c))
  )

(comment
  (add-nums 1 2 3)
  (add-strs "a" "b")
  ; put more examples here
  )
```

</td>
<td>

```clj
(ns user
  (:require
    [clojure.string :as str]))
    

(defn add-nums
  ([a b]
   (+ a b))
  ([a b c]
   (+ a b c)))
  

(defn add-strs
  ([a b]
   (str a b))
  ([a b c]
   (str a b c))
  ([a b c d]
   (str a b c d)))
  

(comment
  (add-nums 1 2 3)
  (add-strs "a" "b"))
  ; put more examples here
  
```

</td>
<td>

```clj
(ns user
  (:require
    [clojure.string :as str]
    ))

(defn add-nums
  ([a b]
     (+ a b))
  ([a b c]
     (+ a b c))
  )

(defn add-strs
  ([a b]
   (str a b))
  ([a b c]
   (str a b c))
  ([a b c d]
   (str a b c d)))
  

(comment
  (add-nums 1 2 3)
  (add-strs "a" "b")
  ; put more examples here
  )
```

</td>

</tr>
<tr>

<td></td>

<td>

```diff
@@ -1,25 +1,27 @@
 (ns user
   (:require
-    [clojure.string :as str]
-    ))
+    [clojure.string :as str]))
+    
 
 (defn add-nums
   ([a b]
-     (+ a b))
+   (+ a b))
   ([a b c]
-     (+ a b c))
-  )
+   (+ a b c)))
+  
 
 (defn add-strs
   ([a b]
-     (str a b))
+   (str a b))
   ([a b c]
-     (str a b c))
-  )
+   (str a b c))
+  ([a b c d]
+   (str a b c d)))
+  
 
 (comment
   (add-nums 1 2 3)
-  (add-strs "a" "b")
+  (add-strs "a" "b"))
   ; put more examples here
-  )
+  
```

</td>

<td>

```diff
@@ -12,10 +12,12 @@
 
 (defn add-strs
   ([a b]
-     (str a b))
+   (str a b))
   ([a b c]
-     (str a b c))
-  )
+   (str a b c))
+  ([a b c d]
+   (str a b c d)))
+  
```

</td>

</tr>
</tbody>
</table>

---
_Source: https://npm.io/package/parstager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
