lib/cli/nodemcu-tool.js
async function fsinfo(format){

    // try to establish a connection to the module
    await getConnection();

    const {metadata, files} = await _nodeMcuConnector.fsinfo();

    // json output - third party applications
    if (format == 'json') {
        writeOutput(JSON.stringify({
            files: files,
            meta: metadata
        }));

    // raw format - suitable for use in bash scripts
    }else if (format == 'raw'){
        // print fileinfo
        files.forEach(function(file){
            writeOutput(file.name);
        });

    }else{
        _mculogger.log('Free Disk Space: ' + metadata.remaining + ' KB | Total: ' + metadata.total + ' KB | ' + files.length + ' Files');

        // files found ?
        if (files.length==0){
            _mculogger.log('No Files found - have you created the file-system?');
        }else{
            _mculogger.log('Files stored into Flash (SPIFFS)');

            // print fileinfo
            files.forEach(function(file){
                _mculogger.log(' - ' + file.name + ' (' + file.size + ' Bytes)');
            });
        }
    }
}
async function fsinfo(format){

    // try to establish a connection to the module
    await getConnection();

    const {metadata, files} = await _nodeMcuConnector.fsinfo();

    // json output - third party applications
    if (format == 'json') {
        writeOutput(JSON.stringify({
            files: files,
            meta: metadata
        }));

    // raw format - suitable for use in bash scripts
    }else if (format == 'raw'){
        // print fileinfo
        files.forEach(function(file){
            writeOutput(file.name);
        });

    }else{
        _mculogger.log('Free Disk Space: ' + metadata.remaining + ' KB | Total: ' + metadata.total + ' KB | ' + files.length + ' Files');

        // files found ?
        if (files.length==0){
            _mculogger.log('No Files found - have you created the file-system?');
        }else{
            _mculogger.log('Files stored into Flash (SPIFFS)');

            // print fileinfo
            files.forEach(function(file){
                _mculogger.log(' - ' + file.name + ' (' + file.size + ' Bytes)');
            });
        }
    }
}
async function fsinfo ( format ) { // try to establish a connection to the module await getConnection ( ) ; const { metadata , files } = await _nodeMcuConnector . fsinfo ( ) ; // json output - third party applications if ( format == 'json' ) { writeOutput ( JSON . stringify ( { files : files , meta : metadata } ) ) ; // raw format - suitable for use in bash scripts } else if ( format == 'raw' ) { // print fileinfo files . forEach ( function ( file ) { writeOutput ( file . name ) ; } ) ; } else { _mculogger . log ( 'Free Disk Space: ' + metadata . remaining + ' KB | Total: ' + metadata . total + ' KB | ' + files . length + ' Files' ) ; // files found ? if ( files . length == 0 ) { _mculogger . log ( 'No Files found - have you created the file-system?' ) ; } else { _mculogger . log ( 'Files stored into Flash (SPIFFS)' ) ; // print fileinfo files . forEach ( function ( file ) { _mculogger . log ( ' - ' + file . name + ' (' + file . size + ' Bytes)' ) ; } ) ; } } }
show file-system info
show file - system info