MCPcopy Create free account
hub / github.com/breck7/scroll / toDisk

Method toDisk

external/.scrollLibs.js:16066–16076  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

16064 return this._subparticlesToXml(0)
16065 }
16066 toDisk(path) {
16067 if (!this.isNodeJs()) throw new Error("This method only works in Node.js")
16068 const format = Particle._getFileFormat(path)
16069 const formats = {
16070 particles: particle => particle.toString(),
16071 csv: particle => particle.asCsv,
16072 tsv: particle => particle.asTsv
16073 }
16074 this.require("fs").writeFileSync(path, formats[format](this), "utf8")
16075 return this
16076 }
16077 _lineToYaml(indentLevel, listTag = "") {
16078 let prefix = " ".repeat(indentLevel)
16079 if (listTag && indentLevel > 1) prefix = " ".repeat(indentLevel - 2) + listTag + " "

Callers

nothing calls this directly

Calls 4

isNodeJsMethod · 0.95
requireMethod · 0.95
_getFileFormatMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected