@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.
Files changed (2) hide show
  1. package/dist/cli.js +6 -1
  2. 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 readFile2(filename, "utf8");
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darkhorseprojects/circuitry",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",