find-repl
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

find-repl

npm coverage npm type definitions license install size

Find and replace text in your project files ✍️

  • does not modify files that git is ignoring
  • will replace all instances in a file, not just the first
  • supports regex in both CLI and API
  • can pass in a glob to scope the files to be searched/modified
  • zero dependencies, tiny footprint

Install

This package is available from the npm registry.

npm install find-repl

Usage (CLI)

When running directly from the CLI, run with npx find-repl.

USAGE:
  find-repl \
    string-to-search-for \ # (or regex:/js-regex-to-search-for/i)
    string-to-replace-with \
    [glob-of-files-to-search-in] # (optional; default all files known to git)

EXAMPLES:
  find-repl string-to-find string-to-replace-with '**/file-matcher-glob.ts'
  find-repl regex:\/\\bfoo\\b\/ bar

API

Supports JavaScript + TypeScript:

import { findRepl } from "find-repl";

await findRepl(/\bLorem\s+ipsum\b/, "Loremus ipsumus", "**/*.md");

Can also be imported via require("find-repl").

Contributing

GitHub issues / PRs welcome.

Dev environment requires:

  • node >= 16.14.0
  • npm >= 6.8.0
  • git >= 2.11

Licence

Apache-2.0

Package Sidebar

Install

npm i find-repl

Weekly Downloads

0

Version

0.1.0

License

Apache-2.0

Unpacked Size

17.8 kB

Total Files

14

Last publish

Collaborators

  • tbjgolden