npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

regexp-it-cli

v3.1.0

Published

Command line application to search text by regular expressions with plenty of features

Downloads

41

Readme

regexp-it-cli NPM version

Command line application to search text by regular expressions

Install

$ npm install --global regexp-it-cli

CLI

$ regexp-it-cli --help

Command line application to search text by regular expressions with plenty of features

Usage
	$ regexp-it-cli

Options
	--source, -s                     Optional source string (can be typed through terminal ui after launching)
	--file, -f                       Optional file which content's should be used as a source
	--url, -u                        Optional url where extract data from which content's should be used as a source
	--regexp, -r                     Optional regexp string (can be typed through terminal ui after launching)
	--regexp-pattern, -p             Use available predefined named pattern as a regexp str
	--quit, -q                       Show matched parts and quit without running interactive ui
	--only-matched-parts, -m         Activate only matched parts option (remove not matched parts from a source)
	--new-line-after-each-match, -n  Add a new line after each match in a source
	--show-borders, -b               Whether to use borders
	--highlight, -h                  Use colors to highligh matched parts
	--slide-mode, -l                 Show all matches in slide mode one after one with specified interval
	--slide-delay, -e                The timer delay in slide mode (in seconds)
	--only-first-match, -i           Show only first match
	--only-last-match, -t            Show only last match
	--after-regexp, -a               Show only matches suceeding specified regex match
	--before-regexp, -o              Show only matches preceding specified regex match
	--starting-line-number           Starting line from a source to be used
	--ending-line-number             Ending line from a source to be used


Examples
	$ regexp-it-cli
	$ regexp-it-cli --source "My text which
is going to be used for regexp expectations"
	$ regexp-it-cli  --source "My sample text
as a source for regexp expectations" --regexp-str "t[a-t]"
	$ regexp-it-cli --file "content.txt" --regexp-str "([Tt]he|a) \w{4,6}\b"
	$ regexp-it-cli --file current.log --regexp-pattern info
	$ regexp-it-cli --file current.log --regexp-pattern error -h f
	$ regexp-it-cli --file server.log --regexp-pattern debug --slide-mode
	$ regexp-it-cli --file file.txt --regexp-pattern url --slide-mode
	$ rgi --file README.md --regexp-pattern url --highlight false
	$ rgi --file README.md --regexp-pattern urlWoP  --slide-mode --only-matched-parts
	$ rgi --file README.md --starting-line-number 6 --regexp-pattern url --only-matched-parts
	$ rgi --file README.md --sln 6 --regexp-pattern url --only-matched-parts
	$ rgi --file README.md --starting-line-number 6 --ending-line-number 15 --regexp-pattern url
	$ rgi --file README.md --sln 6 --eln 15 --regexp-pattern url
	$ rgi --file example.txt --regexp-pattern mention --only-first-match
	$ rgi --file someFile.txt --regexp-pattern articlePlusWord --e
	$ rgi --file index.js --regexp-pattern import -m -e
	$ rgi --file index.js --regexp-pattern import --only-first-match --exit
	$ rgi --file app.log --regexp-pattern error --only-last-match

Demos, Use case

Basic demo

Using predefined patterns

Filtering content between sections

Get matches from url source

Display matches in slide mode

Find repos belonging to specific user

Displaying first and last match

Hiding lines before and after match

Specifying starting/ending line from a source to be used as a content

$ regexp-it-cli --file "samples/awesome-react.md" --regexp ".*lightweight.*" -e -m -q --starting-line-number 130
$ regexp-it-cli --file "samples/awesome-react.md" --regexp ".*lightweight.*" -e -m -q --starting-line-number 130 --ending-line-number 155
$ regexp-it-cli --file "samples/awesome-react.md" --regexp ".*lightweight.*" -e -m -q --sln 130 --eln 155
$ regexp-it-cli --file "samples/awesome-react.md" --regexp ".*lightweight.*" -e -m -q --ending-line-number 155

Screenshots

Example with a source using \b\w{7,8}\b regular expression

Example with a file source

Example using a predefined pattern import using the following options: --regexp-pattern import --only-matched-parts

Example using the .*security.* regexp with --only-matched-partsand--highlight false` options for awesome-dotnet's Readme file as a source (see full markdown file content in raw mode)

Example using the .*computer science.* regexp and --only-matched-parts option for example md file as a source (you can show full markdown file content in here or in raw mode)

Setup neccessary options by opening menu by using Ctrl+O key combination

License

MIT © Rushan Alyautdinov