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.

16 lines (15 loc) 469 B
import { execSync } from "child_process"; import { existsSync, mkdirSync } from "fs"; export function ensureNpmDirectoryExists() { try { const cmd = "npm get prefix"; const prefix = execSync(cmd).toString().trim(); if (prefix?.length && !existsSync(prefix)) { console.log("Creating missing NPM directory at \"" + prefix + "\""); mkdirSync(prefix); } } catch { // ignore } }