Skip to content

Latest commit

 

History

History
92 lines (48 loc) · 1.98 KB

SedFunction.md

File metadata and controls

92 lines (48 loc) · 1.98 KB

nodejsscriptDocs


nodejsscript / s / SedFunction

Interface: SedFunction()

SedFunction(options, searchRegex, replacement, files): ShellString

Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function.

Parameters

options: string

Available options: - -i: Replace contents of 'file' in-place. Note that no backups will be created!

searchRegex: string | RegExp

The regular expression to use for search.

replacement: string

The replacement.

files: string[]

The files to process.

Returns

ShellString

The new string after replacement.

SedFunction(options, searchRegex, replacement, ...files): ShellString

Parameters

options: string

searchRegex: string | RegExp

replacement: string

• ...files: string[]

Returns

ShellString

SedFunction(searchRegex, replacement, files): ShellString

Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function.

Parameters

searchRegex: string | RegExp

The regular expression to use for search.

replacement: string

The replacement.

files: string[]

The files to process.

Returns

ShellString

The new string after replacement.

SedFunction(searchRegex, replacement, ...files): ShellString

Parameters

searchRegex: string | RegExp

replacement: string

• ...files: string[]

Returns

ShellString