Giter Site home page Giter Site logo

replace-x's Issues

Example of use inside code doesn't quite work

I tried to run the example below and didn't work:

var replace = require('replace-x');

replace({
    regex: 'foo',
    replacement: 'bar',
    paths: ['../test/File.txt']
});

I notice if you change to this works fine:

var replace = require('replace-x').default;

Feature request: literal "search" option

This is a very powerful and useful package. However, sometimes it is necessary to search for strings that require unpleasant amounts of escaping to make them valid as a regular expression.

Therefore, a simple feature request:

Offer a command line option --literal or something like that, which makes the search just for the exact literal string provided, not a regular expression.

Error using replace-x 1.7.2 in package.json node 10.16.0

in package json build command:

"ng-build": ng build --configuration=qa --project="app-web" --base-href=./ && replace-x 'ABC' 'XYZ' dist/app/index.html",

Error
fs.js:114
throw err;
^

Error: ENOENT: no such file or directory, lstat 'XYZ'
at Object.lstatSync (fs.js:845:3)
at replaceFileSync (/home/develop/repos/node_modules/replace-x/dist/replace-x.js:217:31)
at Array.forEach ()
at replace (/home/develop/repos/node_modules/replace-x/dist/replace-x.js:266:14)
at Object. (/home/develop/repos/node_modules/replace-x/bin/replace-x.js:42:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.