replace-in-path
TypeScript icon, indicating that this package has built-in type declarations

1.1.0ย โ€ขย Publicย โ€ขย Published

Build code style: prettier PRs Welcome

Install

npm install replace-in-path --save-dev

Or if you prefer yarn:

yarn add replace-in-path --dev

Quick Example:

const codeReplacements = [
    {
        find: `const { security } = this.context;`,
        replaceWith: `// const { security } = this.context;`,
    },
    {
        find: "const identity = await security.getIdentity",
        replaceWith: "// const identity = await security.getIdentity",
    },
    {
        find: new RegExp("createdBy: identity.*},", "gms"),
        replaceWith: "/* $& */",
    },
];

replaceInPath(
    path.join(newCodePath, "/resolvers/TargetDataModelsMutation.ts"),
    codeReplacements
);

Readme

Keywords

Package Sidebar

Install

npm i replace-in-path

Weekly Downloads

432

Version

1.1.0

License

MIT

Unpacked Size

192 kB

Total Files

19

Last publish

Collaborators

  • adrian1210