MCPcopy Create free account
hub / github.com/nodejs/nan / processFile

Function processFile

tools/1to2.js:389–402  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

387
388/* reads a file, runs replacement and writes it back */
389function processFile(file) {
390 fs.readFile(file, {encoding: 'utf8'}, function (err, data) {
391 if (err) {
392 throw err;
393 }
394
395 /* run replacement twice, might need more runs */
396 fs.writeFile(file, data.replace(master, replace).replace(master, replace), function (err) {
397 if (err) {
398 throw err;
399 }
400 });
401 });
402}
403
404/* process file names from command line and process the identified files */
405for (i = 2, length = process.argv.length; i < length; i++) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected