Compare commits

...

7 Commits

5 changed files with 24 additions and 5 deletions

1
.npmignore Normal file
View File

@@ -0,0 +1 @@
package-lock.json

View File

@@ -2,7 +2,7 @@
/* VIBE ALERT
This code was generated using OpenAIs ChatGPT (GPT-5.2 Thinking, large language model).
This code was generated using OpenAI's ChatGPT (GPT-5.2 Thinking, large language model).
The output has not been independently reviewed, audited, or comprehensively validated,
and has only been superficially tested. It should be considered experimental and not fully vetted for production use.
@@ -10,6 +10,7 @@ and has only been superficially tested. It should be considered experimental and
import fs from 'node:fs';
import { stat } from 'node:fs/promises';
import { inspect } from 'node:util';
const lineRe = /^\x1b\[35m\x1b\[K(.*?)\x1b/;
@@ -35,7 +36,7 @@ async function getMtime(line) {
return 0;
}
} else {
throw new Error('Malformed input: ANSI prefix not found');
throw new Error(`Malformed input: ANSI prefix not found for line ${inspect(line)}`);
}
}
@@ -47,7 +48,7 @@ async function main() {
process.stdin.on('end', () => { resolve(data); });
});
const lines = input.split(/(?<=\n)/);
const lines = input.split(/(?<=\n)/).filter(line => line.trim().length > 0);
const pairs = await Promise.all(
lines.map(async (line, index) => {

View File

@@ -1,6 +1,6 @@
{
"name": "efforting-shell-utils",
"version": "0.1.1",
"version": "0.1.2",
"type": "module",
"private": true,
"bin": {

View File

@@ -1,6 +1,19 @@
## Usage
*Here is an example for `jg` (javascript grep):*
```sh
grep --color=always \
-rin "$@" \
--include "*.js" \
--include "*.mjs" \
--exclude "*.min.js" \
--exclude-dir node_modules \
| grep-mtime-sorter | ansi-trunc -l 250
```
## Global Installation
### HTTP
### HTTPS
```sh
sudo npm install -g 'git+https://gitea.efforting.tech/mikael-lovqvist/shell-utils.git#latest'
@@ -8,6 +21,10 @@ sudo npm install -g 'git+https://gitea.efforting.tech/mikael-lovqvist/shell-util
### SSH
> [!CAUTION]
> When you run `npm` as sudo, it will not use your users git configuration or identity. For now HTTPS is recommended instead.
```sh
sudo npm install -g 'git+ssh://git.efforting.tech:mikael-lovqvist/shell-utils.git#latest'
```