popp
v1.0.2
Published
command line tool to pluck the first line out of a file
Downloads
39
Readme
popp
Command line tool to pluck the first line out of a file
Zero dependencies. Requires Node >= 18.
Install
npm install -g poppCLI Usage
Pop the first line off a file and print it to stdout:
popp path/to/file.txtRotate — pop the first line and append it to the end:
popp path/to/file.txt --rotateShow help:
popp --helpProgrammatic Usage
const popp = require("popp")
// pop first line
const line = popp("path/to/file.txt")
// pop and rotate
const line = popp("path/to/file.txt", { rotate: true })Options
| Flag | Short | Description |
|------|-------|-------------|
| --rotate | -r | Move the popped line to the end of the file |
| --help | -h | Show help message |
Test
npm test