Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iambnlvn/head-js
A simple command line tool to print the first few lines of a file, inspired by the Unix head command
https://github.com/iambnlvn/head-js
bun cli unix-command
Last synced: 8 days ago
JSON representation
A simple command line tool to print the first few lines of a file, inspired by the Unix head command
- Host: GitHub
- URL: https://github.com/iambnlvn/head-js
- Owner: iambnlvn
- Created: 2023-11-16T18:04:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-17T12:40:44.000Z (6 months ago)
- Last Synced: 2024-11-26T07:09:09.839Z (2 months ago)
- Topics: bun, cli, unix-command
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Project Name
js head
# Description
A simple command line tool to print the first few lines of a file, inspired by the Unix head command.
Runtime: [Bun](https://bun.sh)# Usage
Install the dependencies with
```bash
bun install
```Run
```bash
bun exec | ./jhead [options] [paths]
```
options:-l, --lines: number of lines to print type: number default: 10
-b, --bytes: number of bytes to print type: number
-t, --tag: print the tag | file name type: boolean default: false
-p, --paths: files path | file name type: string[]
note: if both -l and -b are specified, -l will be ignored and -b will be used as default as it is more specific
example:
```
bun exec && ./jhead -l 11 -t -p README.md
```
![js-headexemple](https://github.com/iambnlvn/head-js/assets/97989036/82f3360c-e6ae-47da-8581-547a1b807be7)Built using [type-flag](https://github.com/privatenumber/type-flag).