0.0.22 • Published 7 years ago

codepuncher v0.0.22

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

Install

npm install -g codepuncher or npm install -D codepuncher

Usage

In your package.json

...
"codepuncher": [
  {
    "filePath": "some/dependency.js",

    "regex": "a+b|c",
    "regexFlags": "g",
    ---or---
    "stringToReplace": "console.debug('stuff');",


    "replacementCode": "//codepuncher removed annoying console.debug log"
  },
  ...
],
...
Or in a separate file, unlabeled
[
  {
    "filePath": "unpk/react-dom.js",
    ...
  },
  ...
]

In your build scripts/cli

codepuncher
Or point to your separate config file
codepuncher local/path/to/config.jsonLike

Node API Usage

const codepuncher = require("codepuncher"),
      punch = codepuncher(punchDataArray)

punch
  .then((files) => files.forEach(({ filePath, code }) => {
    fs.writeFileSync(filePath, code)
  }))
0.0.22

7 years ago

0.0.21

7 years ago

0.0.2

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.1

7 years ago