@rsxlv/nodeexp
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

NodeExp (Node.js Regular Expressions)

A simple command line tool for replacing text in files using regular expressions.

Requirements

  • Node.js
  • yarn

Installation

npx @rsxlv/nodeexp npm install @rsxlv/nodeexp yarn add @rsxlv/nodeexp

Usage

The tool can be run by executing the following command in the terminal: ./npx <regexp> <replace> <files...>

where <regexp> is the regular expression pattern to match, <replace> is the text to replace the matches with, and <files...> is a list of file paths to process.

Examples

npx @rsxlv/nodeexp "world" "universe" file1.txt file2.txt

This command will replace all occurrences of "world" with "universe" in the files file1.txt and file2.txt.

As a library

To import the replaceInFiles function from this project, you can use the following syntax:

import { replaceInFiles } from "@rsxlv/nodeexp/dist";

replaceInFiles(regexp, newString, files);

Readme

Keywords

none

Package Sidebar

Install

npm i @rsxlv/nodeexp

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

12.2 kB

Total Files

12

Last publish

Collaborators

  • rsxdalv