mirror of
https://github.com/cerc-io/watcher-ts
synced 2024-11-19 20:36:19 +00:00
306bbb73ca
* Avoid refetching block while fetching events * Prefetch a batch of blocks with events while indexing * Update mock indexer used in graph-node testing * Process available blocks while prefetching * Refactor events fetching to a method in util * Move method to get GQL event query result to util |
||
---|---|---|
.. | ||
data/entities | ||
templates | ||
types/common | ||
utils | ||
artifacts.ts | ||
checkpoint.ts | ||
client.ts | ||
config.ts | ||
database.ts | ||
entity.ts | ||
events.ts | ||
export-state.ts | ||
fill.ts | ||
generate-code.ts | ||
hooks.ts | ||
import-state.ts | ||
index-block.ts | ||
indexer.ts | ||
inspect-cid.ts | ||
job-runner.ts | ||
lint.ts | ||
package.ts | ||
readme.ts | ||
reset.ts | ||
resolvers.ts | ||
schema.ts | ||
server.ts | ||
tsconfig.ts | ||
types.ts | ||
visitor.ts | ||
watch-contract.ts |
// // Copyright 2021 Vulcanize, Inc. // import fs from 'fs'; import path from 'path'; import Handlebars from 'handlebars'; import { Writable } from 'stream'; const TEMPLATE_FILE = './templates/readme-template.handlebars'; /** * Writes the README.md file generated from a template to a stream. * @param folderName Watcher folder name to be passed to the template. * @param port Watcher server port. * @param outStream A writable output stream to write the README.md file to. */ export function exportReadme (folderName: string, port: number, outStream: Writable): void { const templateString = fs.readFileSync(path.resolve(__dirname, TEMPLATE_FILE)).toString(); const template = Handlebars.compile(templateString); const readmeString = template({ folderName, port }); outStream.write(readmeString); }