MCPcopy
hub / github.com/acode/cli / read

Method read

cli/config.js:77–89  ·  view source on GitHub ↗
(pathname)

Source from the content-addressed store, hash-verified

75 }
76
77 read (pathname) {
78 pathname = pathname || this.fullpath();
79 return fs.readFileSync(pathname).toString()
80 .split('\n')
81 .filter(v => v)
82 .map(line => line.split('='))
83 .reduce((data, values) => {
84 if (values.length > 1) {
85 data[values[0]] = values.slice(1).join('=');
86 }
87 return data;
88 }, {})
89 }
90
91 write (data) {
92 this.data = data = data || this.data;

Callers 1

loadMethod · 0.95

Calls 1

fullpathMethod · 0.95

Tested by

no test coverage detected