swichr

1.0.1 • Public • Published

swichr

What is it?

An NPM module that allows you to replace all instances of a string with another (from an input file), while preserving casing & punctuation

How To Use

  1. Require the swichr module
        const swichr = require('swichr');
        
  2. Pass in (as arguments):
    • a path to your input file
    • a path to your output file
    • the replacing string
    • the string-to-be-replaced
      swichr('in.txt', 'out.txt', 'hi', 'where')
      

Example

in.txt

This is a test where the word "where" appears in multiple cases.
Where?
Here, in this text file! WHERE? Here!

the replacing string: 'hi'

the string-to-be-replaced: 'where'

out.txt

This is a test hi the word "hi" appears in multiple cases.
Hi?
Here, in this text file! HI? Here!

Readme

Keywords

Package Sidebar

Install

npm i swichr

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • nikhilwins