@darkhorseprojects/circuitry 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +6 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -253,7 +253,12 @@ var usage = () => {
|
|
|
253
253
|
if (!command || !filename) usage();
|
|
254
254
|
try {
|
|
255
255
|
if (command === "parse") {
|
|
256
|
-
const text = await
|
|
256
|
+
const text = filename === "--stdin" ? await new Promise((resolve, reject) => {
|
|
257
|
+
let data = "";
|
|
258
|
+
process.stdin.on("data", (chunk) => data += chunk);
|
|
259
|
+
process.stdin.on("end", () => resolve(data));
|
|
260
|
+
process.stdin.on("error", reject);
|
|
261
|
+
}) : await readFile2(filename, "utf8");
|
|
257
262
|
process.stdout.write(JSON.stringify(parseYamlData(text)));
|
|
258
263
|
} else if (command === "check") {
|
|
259
264
|
const loaded = await loadCircuitryGraphFile(filename);
|