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

broccoli-string-replace

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-string-replace

Broccoli plugin to replace a matched string with a replacement.

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40K
decreased by-5.28%
Maintainers
2
Weekly downloads
 
Created
Source

Broccoli's String Replace

Build Status

Summary

Uses String.prototype.replace to replace matched patterns.

Installation

npm install --save-dev broccoli-string-replace

Usage

Files

Replace VERSION_STRING with 1.6.5 in app/main.js:

var replace = require('broccoli-string-replace');

var tree = replace('app', {
  files: [ 'main.js' ],
  pattern: {
    match: /VERSION_STRING/g,
    replacement: '1.6.5'
  }
});

Documentation

replace(inputTree, options)


options.files {Array}

The list of files to process the list of patterns against. This is an array of strings.


options.patterns {Array}

A list of objects with match and replacement properties.


options.pattern {Object}

A single pattern with match and replacement properties.

ZOMG!!! TESTS?!?!!?

I know, right?

Running the tests:

npm install
npm test

License

This project is distributed under the MIT license.

Keywords

FAQs

Package last updated on 19 Feb 2017

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