MCPcopy
hub / github.com/MithrilJS/mithril.js / write

Function write

bundler/tests/test-bundler.js:12–16  ·  view source on GitHub ↗
(filepath, data)

Source from the content-addressed store, hash-verified

10 try {return fs.readFileSync(ns + filepath, "utf8")} catch (e) {/* ignore */}
11}
12function write(filepath, data) {
13 try {var exists = fs.statSync(ns + filepath).isFile()} catch (e) {/* ignore */}
14 if (exists) throw new Error("Don't call `write('" + filepath + "')`. Cannot overwrite file")
15 fs.writeFileSync(ns + filepath, data, "utf8")
16}
17function remove(filepath) {
18 fs.unlinkSync(ns + filepath)
19}

Callers 1

test-bundler.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected