How to use the fs-plus.existsSync function in fs-plus

To help you get started, we’ve selected a few fs-plus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / vscode-iot-workbench / src / Models / RaspberryPiYoctoDevice.ts View on Github external
generateYoctoConfig(folder: string) {
    const filePath = path.join(folder, LocalConstants.configFileName);
    if (!fs.existsSync(filePath)) {
      const config:
          RaspberryPiYoctoConfig = {output: LocalConstants.defaultOutputPath};
      fs.writeFileSync(filePath, JSON.stringify(config, null, 4));
    }
  }
}
github microsoft / vscode-iot-workbench / src / Models / RaspberryPiYoctoDevice.ts View on Github external
async load(): Promise {
    const deviceFolderPath = this.deviceFolder;

    if (!fs.existsSync(deviceFolderPath)) {
      throw new Error('Unable to find the device folder inside the project.');
    }

    if (!fs.existsSync(path.join(deviceFolderPath, 'node_modules'))) {
      cp.exec('npm install', {cwd: deviceFolderPath});
    }
    return true;
  }

fs-plus

node's fs with more helpers

MIT
Latest version published 6 years ago

Package Health Score

50 / 100
Full package analysis