Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vinyl-replace

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vinyl-replace

A Vinyl plugin to replace file contents

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vinyl-replace

A Vinyl plugin to replace file contents.

API

vinylReplace (transform)

Create a transform stream that applies transform to each passed file vinyl. Internally, a file vinyl is one with its contents property set to either a Buffer or Readable stream object. Any other vinyl is passed through as is.

The transform function

The transform function is any callable object accepting as input a string (the vinyl's content) and returning a possibly new version of it, that will be replaced as the new content of the vinyl.

Example

const { src, dest } = require('gulp');
const vinylReplace = require('vinyl-replace');

function myTask () {
  return src('*.txt')
    .pipe(vinylReplace((input) => {
      return input.replace('something', 'everything');
    }))
    .pipe(dest('dist/'));
}

License

This project is distributed under the BSD 3 Clause license (BSD-3-Clause). Please see the LICENSE file.

Keywords

FAQs

Package last updated on 19 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc