replace-in-files-cli
Replace matching strings and regexes in files
Last updated 4 months ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install replace-in-files-cli 
SYNC missed versions from official npm registry.

replace-in-files-cli Build Status

Replace matching strings and regexes in files

Install

$ npm install --global replace-in-files-cli

Usage

$ replace-in-files --help

  Usage
    $ replace-in-files <files…>

  Options
    --regex           Regex pattern to find  (Can be set multiple times)
    --string          String to find  (Can be set multiple times)
    --replacement     Replacement string  (Required)
    --ignore-case     Search case-insensitively
    --no-glob         Disable globbing

  Examples
    $ replace-in-files --string='horse' --regex='unicorn|rainbow' --replacement='????' foo.md
    $ replace-in-files --regex='v\d+\.\d+\.\d+' --replacement=v$npm_package_version foo.css
    $ replace-in-files --string='blob' --replacement='blog' 'some/**/[gb]lob/*' '!some/glob/foo'

  You can use the same replacement patterns as with `String#replace()`, like `$&`.

Real-world use-case: Bumping version number in a file when publishing to npm

Current Tags

  • 1.0.0                                ...           latest (4 months ago)

5 Versions

  • 1.0.0                                ...           4 months ago
  • 0.3.1                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 1
This Week 12
This Month 78
Last Day 2
Last Week 22
Last Month 75
Dependencies (6)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |