MCPcopy Create free account
hub / github.com/porsager/postgres / file

Function file

cf/src/index.js:130–145  ·  view source on GitHub ↗
(path, args = [], options = {})

Source from the content-addressed store, hash-verified

128 }
129
130 function file(path, args = [], options = {}) {
131 arguments.length === 2 && !Array.isArray(args) && (options = args, args = [])
132 const query = new Query([], args, (query) => {
133 fs.readFile(path, 'utf8', (err, string) => {
134 if (err)
135 return query.reject(err)
136
137 query.strings = [string]
138 handler(query)
139 })
140 }, cancel, {
141 ...options,
142 simple: 'simple' in options ? options.simple : args.length === 0
143 })
144 return query
145 }
146 }
147
148 async function listen(name, fn, onlisten) {

Callers

nothing calls this directly

Calls 1

handlerFunction · 0.70

Tested by

no test coverage detected