{"_id":"tippex","_rev":"346069","name":"tippex","description":"Find and erase strings and comments in JavaScript code","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"rich_harris","email":""}],"time":{"modified":"2021-06-20T02:40:07.000Z","created":"2015-12-27T03:52:03.064Z","3.0.0":"2017-04-01T01:34:48.639Z","2.3.1":"2017-01-06T18:50:16.149Z","2.3.0":"2016-10-09T01:36:11.490Z","2.2.0":"2016-04-26T14:08:27.034Z","2.1.2":"2016-04-21T18:37:38.382Z","2.1.1":"2016-04-08T16:48:52.882Z","2.1.0":"2016-02-28T14:58:02.984Z","2.0.0":"2016-02-27T18:37:18.517Z","1.2.0":"2016-02-09T23:27:08.999Z","1.1.0":"2015-12-27T14:08:46.173Z","1.0.0":"2015-12-27T03:52:03.064Z"},"users":{},"author":{"name":"Rich Harris"},"repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"versions":{"3.0.0":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"3.0.0","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","module":"dist/tippex.es.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"bench":"node bench","test":"mocha --compilers js:buble/register","prebench":"npm run build","pretest":"npm run build","build":"rollup -c","prepublish":"npm run lint && rm -rf dist && npm test","lint":"eslint src"},"devDependencies":{"acorn":"^4.0.11","benchmark":"^2.1.3","buble":"^0.15.2","console-group":"^0.3.3","eslint":"^3.17.1","locate-character":"^2.0.0","glob":"^7.1.1","mocha":"^3.2.0","pretty-bytes":"^4.0.2","pretty-ms":"^2.1.0","rollup":"^0.41.5","rollup-plugin-buble":"^0.15.0","rollup-plugin-node-resolve":"^2.0.0","source-map-support":"^0.4.12"},"gitHead":"1cb2122de6e32ca98624872306570d27b5253ae5","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@3.0.0","_shasum":"b17609a27ceaffe0797b387393fd99878e4d7ea9","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"b17609a27ceaffe0797b387393fd99878e4d7ea9","size":12497,"noattachment":false,"key":"/tippex/-/tippex-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-3.0.0.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/tippex-3.0.0.tgz_1491010487955_0.1008435869589448"},"directories":{},"publish_time":1491010488639,"_cnpm_publish_time":1491010488639,"_hasShrinkwrap":false},"2.3.1":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"2.3.1","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","jsnext:main":"dist/tippex.es6.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"test":"mocha --compilers js:buble/register","pretest":"npm run build:umd","build":"npm run build:umd && npm run build:es6","build:umd":"rollup -c -f umd -o dist/tippex.umd.js","build:es6":"rollup -c -f es6 -o dist/tippex.es6.js","prepublish":"npm run lint && rm -rf dist && npm test && npm run build:es6","lint":"eslint src"},"devDependencies":{"buble":"^0.15.1","eslint":"^3.12.2","mocha":"^3.2.0","rollup":"^0.40.2","rollup-plugin-buble":"^0.15.0","source-map-support":"^0.4.0"},"gitHead":"99093ae63699ef1678ddd9654a09c50a413bce9a","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@2.3.1","_shasum":"a2fd5b7087d7cbfb20c9806a6c16108c2c0fafda","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.2.1","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"a2fd5b7087d7cbfb20c9806a6c16108c2c0fafda","size":11370,"noattachment":false,"key":"/tippex/-/tippex-2.3.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-2.3.1.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/tippex-2.3.1.tgz_1483728615516_0.0026693588588386774"},"directories":{},"publish_time":1483728616149,"_cnpm_publish_time":1483728616149,"_hasShrinkwrap":false},"2.3.0":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"2.3.0","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","jsnext:main":"dist/tippex.es6.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"test":"mocha --compilers js:buble/register","pretest":"npm run build:umd","build":"npm run build:umd && npm run build:es6","build:umd":"rollup -c -f umd -o dist/tippex.umd.js","build:es6":"rollup -c -f es6 -o dist/tippex.es6.js","prepublish":"npm run lint && rm -rf dist && npm test && npm run build:es6","lint":"eslint src"},"devDependencies":{"buble":"^0.5.2","eslint":"^2.8.0","mocha":"^2.4.5","rollup":"^0.25.8","rollup-plugin-buble":"^0.6.0","source-map-support":"^0.4.0"},"gitHead":"f588d33af60092ee7714008f353bbd082421de11","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@2.3.0","_shasum":"4ff663dbd2e12e90126e078789282a3fa8a9c007","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"4ff663dbd2e12e90126e078789282a3fa8a9c007","size":11247,"noattachment":false,"key":"/tippex/-/tippex-2.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-2.3.0.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/tippex-2.3.0.tgz_1475976970858_0.02243978576734662"},"directories":{},"publish_time":1475976971490,"_cnpm_publish_time":1475976971490,"_hasShrinkwrap":false},"2.2.0":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"2.2.0","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","jsnext:main":"dist/tippex.es6.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"test":"mocha --compilers js:buble/register","pretest":"npm run build:umd","build":"npm run build:umd && npm run build:es6","build:umd":"rollup -c -f umd -o dist/tippex.umd.js","build:es6":"rollup -c -f es6 -o dist/tippex.es6.js","prepublish":"npm run lint && rm -rf dist && npm test && npm run build:es6","lint":"eslint src"},"devDependencies":{"buble":"^0.5.2","eslint":"^2.8.0","mocha":"^2.4.5","rollup":"^0.25.8","rollup-plugin-buble":"^0.6.0","source-map-support":"^0.4.0"},"gitHead":"cc12ba0c74fbdef39eba15381cd5ae663818141d","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@2.2.0","_shasum":"dc143424c49e441eb2bac6ee6641d54a9c89b60c","_from":".","_npmVersion":"3.8.3","_nodeVersion":"5.10.1","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"dc143424c49e441eb2bac6ee6641d54a9c89b60c","size":11705,"noattachment":false,"key":"/tippex/-/tippex-2.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-2.2.0.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/tippex-2.2.0.tgz_1461679704512_0.38927422370761633"},"directories":{},"publish_time":1461679707034,"_cnpm_publish_time":1461679707034,"_hasShrinkwrap":false},"2.1.2":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"2.1.2","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","jsnext:main":"dist/tippex.es6.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"test":"mocha --compilers js:buble/register","pretest":"npm run build:umd","build":"npm run build:umd && npm run build:es6","build:umd":"rollup -c -f umd -o dist/tippex.umd.js","build:es6":"rollup -c -f es6 -o dist/tippex.es6.js","prepublish":"npm run lint && rm -rf dist && npm test && npm run build:es6","lint":"eslint src"},"devDependencies":{"buble":"^0.5.2","eslint":"^2.8.0","mocha":"^2.4.5","rollup":"^0.25.8","rollup-plugin-buble":"^0.5.0","source-map-support":"^0.4.0"},"gitHead":"92d203d3e4ff0a52b245db4869de52e3ab060310","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@2.1.2","_shasum":"3780489c6e26b1da71ee1b85e7c979b03925c9ef","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"3780489c6e26b1da71ee1b85e7c979b03925c9ef","size":8138,"noattachment":false,"key":"/tippex/-/tippex-2.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-2.1.2.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/tippex-2.1.2.tgz_1461263856173_0.3302574569825083"},"directories":{},"publish_time":1461263858382,"_cnpm_publish_time":1461263858382,"_hasShrinkwrap":false},"2.1.1":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"2.1.1","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","jsnext:main":"dist/tippex.es6.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"test":"mocha --compilers js:babel-register","pretest":"npm run build:umd","build":"npm run build:umd && npm run build:es6","build:umd":"rollup -c -f umd -o dist/tippex.umd.js","build:es6":"rollup -c -f es6 -o dist/tippex.es6.js","prepublish":"npm run lint && rm -rf dist && npm test && npm run build:es6","lint":"eslint src"},"devDependencies":{"babel-preset-es2015":"^6.3.13","babel-preset-es2015-rollup":"^1.0.0","babel-register":"^6.3.13","eslint":"^1.10.3","mocha":"^2.3.4","rollup":"^0.22.0","rollup-plugin-babel":"^2.2.0","source-map-support":"^0.4.0"},"gitHead":"52097cad48ca92e91b0d0b24f99056f8802f0a43","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@2.1.1","_shasum":"e16c4328bddf1b548b77e2871373e019db3095fa","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"e16c4328bddf1b548b77e2871373e019db3095fa","size":12058,"noattachment":false,"key":"/tippex/-/tippex-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-2.1.1.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/tippex-2.1.1.tgz_1460134130421_0.9016263198573142"},"directories":{},"publish_time":1460134132882,"_cnpm_publish_time":1460134132882,"_hasShrinkwrap":false},"2.1.0":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"2.1.0","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","jsnext:main":"dist/tippex.es6.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"test":"mocha --compilers js:babel-register","pretest":"npm run build:umd","build":"npm run build:umd && npm run build:es6","build:umd":"rollup -c -f umd -o dist/tippex.umd.js","build:es6":"rollup -c -f es6 -o dist/tippex.es6.js","prepublish":"npm run lint && rm -rf dist && npm test && npm run build:es6","lint":"eslint src"},"devDependencies":{"babel-preset-es2015":"^6.3.13","babel-preset-es2015-rollup":"^1.0.0","babel-register":"^6.3.13","eslint":"^1.10.3","mocha":"^2.3.4","rollup":"^0.22.0","rollup-plugin-babel":"^2.2.0","source-map-support":"^0.4.0"},"gitHead":"ec581a4e9eeb1b0c93715511fe41ff8144b9c632","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@2.1.0","_shasum":"5384c784bf094e8634c10cd62d0d1a5d93104b5e","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"5384c784bf094e8634c10cd62d0d1a5d93104b5e","size":10486,"noattachment":false,"key":"/tippex/-/tippex-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-2.1.0.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/tippex-2.1.0.tgz_1456671480077_0.05185977555811405"},"directories":{},"publish_time":1456671482984,"_cnpm_publish_time":1456671482984,"_hasShrinkwrap":false},"2.0.0":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"2.0.0","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","jsnext:main":"dist/tippex.es6.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"test":"mocha --compilers js:babel-register","pretest":"npm run build:umd","build":"npm run build:umd && npm run build:es6","build:umd":"rollup -c -f umd -o dist/tippex.umd.js","build:es6":"rollup -c -f es6 -o dist/tippex.es6.js","prepublish":"npm run lint && rm -rf dist && npm test && npm run build:es6","lint":"eslint src"},"devDependencies":{"babel-preset-es2015":"^6.3.13","babel-preset-es2015-rollup":"^1.0.0","babel-register":"^6.3.13","eslint":"^1.10.3","mocha":"^2.3.4","rollup":"^0.22.0","rollup-plugin-babel":"^2.2.0","source-map-support":"^0.4.0"},"gitHead":"e89397eb53b40f340e9cb3e0dbcd16a8222f7c9b","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@2.0.0","_shasum":"5551d160a67a567e769b92505ca650f747868bd3","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.6.0","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"5551d160a67a567e769b92505ca650f747868bd3","size":10243,"noattachment":false,"key":"/tippex/-/tippex-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-2.0.0.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/tippex-2.0.0.tgz_1456598235504_0.733804798219353"},"directories":{},"publish_time":1456598238517,"_cnpm_publish_time":1456598238517,"_hasShrinkwrap":false},"1.2.0":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"1.2.0","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","jsnext:main":"dist/tippex.es6.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"test":"mocha --compilers js:babel-register","pretest":"npm run build:umd","build":"npm run build:umd && npm run build:es6","build:umd":"rollup -c -f umd -o dist/tippex.umd.js","build:es6":"rollup -c -f es6 -o dist/tippex.es6.js","prepublish":"rm -rf dist && npm test && npm run build:es6"},"devDependencies":{"babel-preset-es2015":"^6.3.13","babel-preset-es2015-rollup":"^1.0.0","babel-register":"^6.3.13","eslint":"^1.10.3","mocha":"^2.3.4","rollup":"^0.22.0","rollup-plugin-babel":"^2.2.0","source-map-support":"^0.4.0"},"gitHead":"b86c3cfc23342b2b740637cc3e661550ed38f0a1","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@1.2.0","_shasum":"20e5bf3f922e275513f8671cc1b4156a29f21411","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"20e5bf3f922e275513f8671cc1b4156a29f21411","size":9237,"noattachment":false,"key":"/tippex/-/tippex-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-1.2.0.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"_npmOperationalInternal":{"host":"packages-6-west.internal.npmjs.com","tmp":"tmp/tippex-1.2.0.tgz_1455060425981_0.19242295785807073"},"directories":{},"publish_time":1455060428999,"_cnpm_publish_time":1455060428999,"_hasShrinkwrap":false},"1.1.0":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"1.1.0","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","jsnext:main":"dist/tippex.es6.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"test":"mocha --compilers js:babel-register","pretest":"npm run build:umd","build":"npm run build:umd && npm run build:es6","build:umd":"rollup -c -f umd -o dist/tippex.umd.js","build:es6":"rollup -c -f es6 -o dist/tippex.es6.js","prepublish":"rm -rf dist && npm test && npm run build:es6"},"devDependencies":{"babel-preset-es2015":"^6.3.13","babel-preset-es2015-rollup":"^1.0.0","babel-register":"^6.3.13","eslint":"^1.10.3","mocha":"^2.3.4","rollup":"^0.22.0","rollup-plugin-babel":"^2.2.0","source-map-support":"^0.4.0"},"gitHead":"eb175dbdfad9d3e24d42673ca7ac693ce0c66312","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@1.1.0","_shasum":"d835d0bbe6367abd8d8986bfd74c2008e16c8213","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.1","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"d835d0bbe6367abd8d8986bfd74c2008e16c8213","size":6886,"noattachment":false,"key":"/tippex/-/tippex-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-1.1.0.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"directories":{},"publish_time":1451225326173,"_cnpm_publish_time":1451225326173,"_hasShrinkwrap":false},"1.0.0":{"name":"tippex","description":"Find and erase strings and comments in JavaScript code","version":"1.0.0","author":{"name":"Rich Harris"},"main":"dist/tippex.umd.js","jsnext:main":"dist/tippex.es6.js","files":["src","dist","README.md"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Rich-Harris/tippex.git"},"scripts":{"test":"mocha --compilers js:babel-register","pretest":"npm run build:umd","build":"npm run build:umd && npm run build:es6","build:umd":"rollup -c -f umd -o dist/tippex.umd.js","build:es6":"rollup -c -f es6 -o dist/tippex.es6.js","prepublish":"rm -rf dist && npm test && npm run build:es6"},"devDependencies":{"babel-preset-es2015":"^6.3.13","babel-preset-es2015-rollup":"^1.0.0","babel-register":"^6.3.13","eslint":"^1.10.3","mocha":"^2.3.4","rollup":"^0.22.0","rollup-plugin-babel":"^2.2.0","source-map-support":"^0.4.0"},"gitHead":"3a781c9a57d7cbf2c45342a1b2e5da0d41c0bfc0","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"homepage":"https://github.com/Rich-Harris/tippex#readme","_id":"tippex@1.0.0","_shasum":"c19ac60a76b7954127e55875a9646698508b34e1","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.1.1","_npmUser":{"name":"rich_harris","email":"richard.a.harris@gmail.com"},"dist":{"shasum":"c19ac60a76b7954127e55875a9646698508b34e1","size":5804,"noattachment":false,"key":"/tippex/-/tippex-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/tippex/download/tippex-1.0.0.tgz"},"maintainers":[{"name":"rich_harris","email":""}],"directories":{},"publish_time":1451188323064,"_cnpm_publish_time":1451188323064,"_hasShrinkwrap":false}},"readme":"# Tippex\n\nErase comments, strings and regular expressions from JavaScript code.\n\n## Why?\n\nSay you want to do some very simple code analysis, such as finding `import` and `export` statements. You *could* just skim over the code with a regex, but you'll get bad results if matches exist inside comments or strings:\n\n```js\nimport a from './a.js';\n// import b from './b.js'; TODO do we need this?\n```\n\nInstead, you might generate an abstract syntax tree with a parser like [Acorn](https://github.com/ternjs/acorn), and traverse the AST looking for nodes of a specific type. But for a lot of simple tasks that's overkill – parsing is expensive, traversing is a lot less simple than using regular expressions, and if you're doing anything in the browser it's better to avoid large dependencies.\n\nTippex offers some middle ground. It's as robust as a full-fledged parser, but miniscule – and much faster. (Americans: Tippex is what you oddballs call 'Liquid Paper' or 'Wite-Out'.)\n\n\n## What does it do?\n\nTippex simply replaces the contents of strings (including ES6 template strings), regular expressions and comments with the equivalent whitespace.\n\nSo this...\n\n```js\nvar a = 1; // line comment\n/*\n  block comment\n*/\nvar b = 2;\nvar c = /\\w+/;\nvar d = 'some text';\nvar e = \"some more text\";\nvar f = `an ${ 'unnecessarily' ? `${'complicated'}` : `${'template'}` } string`;\n```\n\n...becomes this:\n\n```js\nvar a = 1; //\n/*\n\n*/\nvar b = 2;\nvar c = /   /;\nvar d = '         ';\nvar e = \"              \";\nvar f = `   ${ '             ' ? `${'           '}` : `${'        '}` }       `;\n```\n\nOnce that's done, you can search for patterns (such as `var` or ` = ` or `import`) in complete confidence that you won't get any false positives.\n\n\n## Installation\n\n```bash\nnpm install --save tippex\n```\n\n...or download from unpkg.com ([UMD version](https://unpkg.com/tippex), [ES6 exports version](https://unpkg.com/tippex/dist/tippex.es.js)).\n\n\n## Usage\n\n```js\nimport * as tippex from 'tippex'; // or `var tippex = require('tippex')`, etc\n\nvar erased = tippex.erase( 'var a = 1; // line comment' );\n// -> 'var a = 1; //             '\n\nvar found = tippex.find( 'var a = 1; // line comment' );\n// -> [{\n//      start: 11,\n//      end: 26,\n//      type: 'line',\n//      outer: '// line comment',\n//      inner: ' line comment'\n//    }]\n```\n\nSometimes you might need to match a regular expression against the original string, but ignoring comments etc. For that you can use `tippex.match`:\n\n```js\nvar code = `\nimport a from './a.js';\n// import b from './b.js'; TODO do we need this?\n`;\n\nvar importPattern = /import (.+?) from '([^']+)'/g; // must have 'g' flag\nvar importDeclarations = [];\n\ntippex.match( code, importPattern, ( match, name, source ) => {\n  // this callback will be called for each match that *doesn't* begin\n  // inside a comment, string or regular expression\n  importDeclarations.push({ name, source });\n});\n\nconsole.log( importDeclarations );\n// -> [{\n//       name: 'a',\n//       source: './a.js'\n//    }]\n```\n\n(A complete regular expression for ES6 imports would be a bit more complicated; this is for illustrative purposes.)\n\nTo replace occurrences of a pattern that aren't inside strings or comments, use `tippex.replace`:\n\n```js\ncode = tippex.replace( code, importPattern, ( match, name, source ) => {\n  return `var ${name} = require('${source}')`;\n});\n```\n\n\n## Known issues\n\nIt's extremely difficult to distinguish between regular expression literals and division operators in certain edge cases at the lexical level. Fortunately, these cases are rare and generally somewhat contrived. If you encounter one in the wild, please raise an issue so we can try to accommodate it.\n\n\n\n## License\n\nMIT\n\n----\n\nFollow [@Rich_Harris](https://twitter.com/Rich_Harris) on Twitter for more artisanal, hand-crafted JavaScript.\n","_attachments":{},"homepage":"https://github.com/Rich-Harris/tippex#readme","bugs":{"url":"https://github.com/Rich-Harris/tippex/issues"},"license":"MIT"}