replace

WebJar for replace

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

replace
Последняя версия

Последняя версия

0.3.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

replace
WebJar for replace
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/harthur/replace

Скачать replace

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/replace/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>replace</artifactId>
    <version>0.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/replace/
implementation 'org.webjars.npm:replace:0.3.0'
// https://jarcasting.com/artifacts/org.webjars.npm/replace/
implementation ("org.webjars.npm:replace:0.3.0")
'org.webjars.npm:replace:jar:0.3.0'
<dependency org="org.webjars.npm" name="replace" rev="0.3.0">
  <artifact name="replace" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='replace', version='0.3.0')
)
libraryDependencies += "org.webjars.npm" % "replace" % "0.3.0"
[org.webjars.npm/replace "0.3.0"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.webjars.npm : nomnom jar [1.6,1.7)
org.webjars.npm : colors jar [0.5,0.6)
org.webjars.npm : minimatch jar [0.2.9,0.3)

Модули Проекта

Данный проект не имеет модулей.

replace

replace is a command line utility for performing search-and-replace on files. It's similar to sed but there are a few differences:

Install

With node.js and npm:

npm install replace -g

You can now use replace and search from the command line.

Examples

Replace all occurrences of "foo" with "bar" in files in the current directory:

replace 'foo' 'bar' *

Replace in all files in a recursive search of the current directory:

replace 'foo' 'bar' . -r

Replace only in test/file1.js and test/file2.js:

replace 'foo' 'bar' test/file1.js test/file2.js

Replace all word pairs with "_" in middle with a "-":

replace '(\w+)_(\w+)' '$1-$2' *

Replace only in files with names matching *.js:

replace 'foo' 'bar' . -r --include="*.js"

Don't replace in files with names matching *.min.js and *.py:

replace 'foo' 'bar' . -r --exclude="*.min.js,*.py"

Preview the replacements without modifying any files:

replace 'foo' 'bar' . -r --preview

See all the options:

replace -h

Search

There's also a search command. It's like grep, but with replace's syntax.

search "setTimeout" . -r

Programmatic Usage

You can use replace from your JS program:

var replace = require("replace");

replace({
  regex: "foo",
  replacement: "bar",
  paths: ['.'],
  recursive: true,
  silent: true,
});

More Details

Excludes

By default, replace and search will exclude files (binaries, images, etc) that match patterns in the "defaultignore" located in this directory.

On huge directories

If replace is taking too long on a large directory, try turning on the quiet flag with -q, only including the necessary file types with --include or limiting the lines shown in a preview with -n.

What it looks like

replace

Версии библиотеки

Версия
0.3.0