Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Node Folder or file exists

const { exists } = require("fs");  
var fs = require( 'fs' ),
    path = require( 'path' ),
    expect = require( 'expect' ),

  exists(path.join(__dirname, "
ode_modules.bin"), (e) => {
    console.log(e ? "
ode_modules.bin exists" : "
Install missing packages
");
  });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Node #Folder #file #exists
ADD COMMENT
Topic
Name
6+2 =