function getPackages(app, cb = null) {
  let stdout = '';
  const ls = spawn('npm', ['ls', '--json', '--prod', '--depth=0', '--long']);
  ls.stdout.on('data', data => {
    stdout += data;
  });
  ls.stderr.on('data', data => {
    app.error(`stderr: ${data}`);
  });
  ls.on('close', (code) => {
    if (0 !== code) app.error('child process exited with code %s', code);
    app.debug('loading installed zealder packages');
    var p = JSON.parse(stdout);
    if (p.dependencies) {
      // now set packages to state
      setPackagesState(app, p.dependencies, cb);
    }
  });
}
function getPackages(app, cb = null) {
  let stdout = '';
  const ls = spawn('npm', ['ls', '--json', '--prod', '--depth=0', '--long']);
  ls.stdout.on('data', data => {
    stdout += data;
  });
  ls.stderr.on('data', data => {
    app.error(`stderr: ${data}`);
  });
  ls.on('close', (code) => {
    if (0 !== code) app.error('child process exited with code %s', code);
    app.debug('loading installed zealder packages');
    var p = JSON.parse(stdout);
    if (p.dependencies) {
      
      setPackagesState(app, p.dependencies, cb);
    }
  });
}
function getPackages ( app , cb = null ) { let stdout = '' ; const ls = spawn ( 'npm' , [ 'ls' , '--json' , '--prod' , '--depth=0' , '--long' ] ) ; ls . stdout . on ( 'data' , data => { stdout += data ; } ) ; ls . stderr . on ( 'data' , data => { app . error ( ` ${ data } ` ) ; } ) ; ls . on ( 'close' , ( code ) => { if ( 0 !== code ) app . error ( 'child process exited with code %s' , code ) ; app . debug ( 'loading installed zealder packages' ) ; var p = JSON . parse ( stdout ) ; if ( p . dependencies ) { // now set packages to state setPackagesState ( app , p . dependencies , cb ) ; } } ) ; }
get all installed zealder apps/themes
get all installed zealder apps / themes