Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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).