🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

find-repl

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-repl

Find and replace text in your project files ✍️

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

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

Keywords

find

FAQs

Package last updated on 24 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts