@automattic/vip-search-replace

v1.1.3
A Node package interface to a Go powered search and replace package

nlm-github nlm-version

VIP Search & Replace

How to use this package?

const { replace } = require( '@automattic/vip-search-replace' );

// Create a readable and writeable stream. Can be any stream: File, std, etc...
const readableStream = fs.createReadStream( 'path_to_sql_file.sql' );
const writeableStream = fs.createWriteStream( 'path_to_sql_file_replaced.sql', { encoding: 'utf8' } );

const result = await replace( readableStream, [ 'thisdomain.com', 'thatdomain.com' ] );

result.pipe( writeableStream );

Contributing

For details about contributing to this project (e.g. setting up development environment, publishing a release, etc.), please see CONTRIBUTING.md.

npm i @automattic/vip-search-replace

Metadata

  • MIT
  • Whatever
  • WordPress VIP
  • released 1/11/2024

Downloads