UNPKG

@needle-tools/engine

Version:

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in

20 lines (19 loc) 736 B
import { existsSync, readFileSync } from "fs"; export function getMeta() { const workingDirectory = process.cwd(); const configPath = workingDirectory + "/needle.config.json"; if(existsSync(configPath)) { const configStr = readFileSync(configPath); const config = JSON.parse(configStr); if(config.codegenDirectory) { const dir = workingDirectory + "/" + config.codegenDirectory + "/meta.json"; if(existsSync(dir)) { const metaStr = readFileSync(dir); /**@type {import("../types").needleConfig} */ const meta = JSON.parse(metaStr); return meta; } } } return null; }