1.5.0 • Published 1 year ago

@schemcraft/replace v1.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@schemcraft/replace

A custom Angular schematic to replace occurrences of a specified old value with a new value in your application files. This tool can be especially useful for refactoring and updating configurations throughout your codebase.

Table of Contents

Installation

You can install the package using npm:

npm install @schemcraft/replace

Usage

After installation, you can use the schematic in your Angular project. Navigate to your Angular project directory and run the following command:

schematics @schemcraft/replace:replace --old-value="OLD_VALUE" --new-value="NEW_VALUE"

Options

  • --old-value: The value you want to replace (required).
  • --new-value: The new value that will replace the old value (required).
  • --file-path: (Optional) The path of the file where the replacement should be made. If not provided, the schematic will search through all relevant files in the project.

Examples

Replace in Specific File

To replace "hello" with "world" in a specific file:

schematics @schemcraft/replace:replace --old-value="hello" --new-value="world" --file-path="./src/app/app.component.ts"

Replace in All Relevant Files

To replace "foo" with "bar" throughout the entire project:

schematics @schemcraft/replace:replace --old-value="foo" --new-value="bar"

Contributing

Contributions are welcome! Please feel free to open issues or submit pull requests to improve this schematic. Make sure to follow the contribution guidelines if you create a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.