Useful when using Fiddler Autoresponder with builds that generate dynamic filenames, as in create-react-app
.
npm install farx --save-dev
Declare a rule json as follows:
const rule = [
{
match: "https://a.com/1.jpg",
action: "C:\\Documents\\1.jpg"
}
]
To generate farx xml :
const farxxml = farx.generate(rule);
To save farx xml in Desktop, with callback on save:
const desktopPath = require('path').join(require('os').homedir(), 'Desktop');
const farxxml = farx.generate(rule,desktopPath, (farxfile) => {
//farxfile is the path to the newly generated file in Desktop
} );