Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Node.js",
"image": "mcr.microsoft.com/devcontainers/javascript-node",
"customizations": {
"vscode": {
"extensions": [
"editorconfig.editorconfig"
]
}
},
"postCreateCommand": "sudo npm install -g npm-check-updates"
}
9 changes: 4 additions & 5 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: Tests

on:
push:
branches:
- main
pull_request:
branches: ['*']
branches: [main]
pull_request:
branches: [main]

jobs:
build:
Expand All @@ -18,7 +17,7 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Enable pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
contents: write
id-token: write
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.nx/cache
.nx/workspace-data
.pnpm-store/
.vscode/
*.d.ts
coverage/
Expand Down
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@ npm install @cto.af/chex-cli
Usage: chex [options] [file...]

Arguments:
file file names to read or "-" for stdin
file file names to read or "-" for stdin

Options:
-c,--colors force colors on even if stdout is not a tty
-d,--dots use dots for more control characters, instead of
Unicode representations
-s,--strings <encoding> try to decode strings in this encoding (choices:
"utf8", "utf-8")
-h, --help display help for command
-c,--colors force colors on even if stdout is not a tty
--no-colors force colors off even if stdout is a tty
-C,--columns <number> how many columns of 8 bytes? (default: 2)
-d,--dots use dots for more control characters, instead of
Unicode representations
-p,--pager [pager command] override PAGER environment variable. If no
command is specified, turn off paging. Suggested:
"less -REX". (default: "less -REX")
-s,--strings <encoding> try to decode strings in this encoding (choices:
"utf8", "utf-8")
-V, --version output the version number
-h, --help display help for command
```

[![Tests](https://github.com/cto-af/chex/actions/workflows/node.js.yml/badge.svg)](https://github.com/cto-af/chex/actions/workflows/node.js.yml)
Expand Down
19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,21 @@
"author": "Joe Hildebrand <joe-github@cursive.net>",
"license": "MIT",
"devDependencies": {
"@cto.af/eslint-config": "6.1.0",
"@cto.af/eslint-config": "6.2.4",
"@cto.af/monopub": "1.2.2",
"@types/node": "24.9.2",
"ava": "6.4.1",
"c8": "10.1.3",
"eslint": "9.38.0",
"eslint-plugin-ava": "15.1.0",
"@types/node": "25.3.2",
"ava": "7.0.0",
"c8": "11.0.0",
"eslint": "10.0.2",
"eslint-plugin-ava": "16.0.0",
"typescript": "5.9.3"
},
"packageManager": "pnpm@10.20.0",
"packageManager": "pnpm@10.30.3",
"pnpm": {
"overrides": {
"c8@11.0.0>yargs": "18.0.0"
}
},
"engines": {
"node": ">=20"
}
Expand Down
35 changes: 35 additions & 0 deletions pkg/chex-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# chex-cli

Like `hexdump -C`, but as a small JS library.

## Install

```
npm install @cto.af/chex-cli
```

## Usage

```
Usage: chex [options] [file...]

Arguments:
file file names to read or "-" for stdin

Options:
-c,--colors force colors on even if stdout is not a tty
--no-colors force colors off even if stdout is a tty
-C,--columns <number> how many columns of 8 bytes? (default: 2)
-d,--dots use dots for more control characters, instead of
Unicode representations
-p,--pager [pager command] override PAGER environment variable. If no
command is specified, turn off paging. Suggested:
"less -REX". (default: "less -REX")
-s,--strings <encoding> try to decode strings in this encoding (choices:
"utf8", "utf-8")
-V, --version output the version number
-h, --help display help for command
```

[![Tests](https://github.com/cto-af/chex/actions/workflows/node.js.yml/badge.svg)](https://github.com/cto-af/chex/actions/workflows/node.js.yml)
[![codecov](https://codecov.io/gh/cto-af/chex/graph/badge.svg?token=S79ZXFIMZS)](https://codecov.io/gh/cto-af/chex)
8 changes: 4 additions & 4 deletions pkg/chex-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
},
"dependencies": {
"@cto.af/chex": "2.2.1",
"commander": "14.0.2"
"commander": "14.0.3"
},
"devDependencies": {
"@types/node": "24.9.2",
"execa": "9.6.0",
"package-extract": "3.1.3"
"@types/node": "25.3.2",
"execa": "9.6.1",
"package-extract": "3.1.5"
},
"engines": {
"node": ">=20"
Expand Down
26 changes: 26 additions & 0 deletions pkg/chex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# chex

Like `hexdump -C`, but as a small JS library.

## Install

```
npm install @cto.af/chex
```

## Usage

```js
import {HexDumpTransform, hexDump} from 'chex';
console.log(hexDump(new Uint8Array([0x61, 0x62, 0x63])));
// 00000000 61 62 63 |abc|
// 00000003 Total
const t = new HexDumpTransform();
t.pipe(process.stdout);
t.end(new Uint8Array([0x61, 0x62, 0x63]));
// 00000000 61 62 63 |abc|
// 00000003 Total
```

[![Tests](https://github.com/cto-af/chex/actions/workflows/node.js.yml/badge.svg)](https://github.com/cto-af/chex/actions/workflows/node.js.yml)
[![codecov](https://codecov.io/gh/cto-af/chex/graph/badge.svg?token=S79ZXFIMZS)](https://codecov.io/gh/cto-af/chex)
6 changes: 3 additions & 3 deletions pkg/chex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
"author": "Joe Hildebrand <joe-github@cursive.net>",
"license": "MIT",
"dependencies": {
"@cto.af/utils": "1.3.5"
"@cto.af/utils": "1.4.1"
},
"devDependencies": {
"@types/node": "24.9.2",
"package-extract": "3.1.3",
"@types/node": "25.3.2",
"package-extract": "3.1.5",
"typescript": "5.9.3"
},
"engines": {
Expand Down
Loading