MCPcopy Create free account
hub / github.com/thinkjs/thinkjs / createFile

Function createFile

test/lib/utils.js:7–16  ·  view source on GitHub ↗
(dir, filename, content, cb)

Source from the content-addressed store, hash-verified

5const CONFIG_PATH = path.resolve(__dirname, '../runtime/config');
6
7function createFile(dir, filename, content, cb) {
8 if (!fs.existsSync(dir)) {
9 mkdirp.sync(dir);
10 }
11 let filePath = path.join(dir, filename);
12 fs.openSync(filePath, 'w');
13 if (content) {
14 fs.writeFile(filePath, content, cb);
15 }
16}
17
18function touchConfig(config = {}, cb) {
19 let json = JSON.stringify(config,function(key, val) {

Callers 1

touchConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…