How to use drivelist - 7 common examples

To help you get started, we’ve selected a few drivelist 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 danelkhen / desktopbrowser / server / src / utils / io.ts View on Github external
static async GetDrives4(): Promise {
        const drives = await drivelist.list();
        return drives;
        // const list:DiskInfoItem[] = []
        // for(const drive of drives){
        //     const item:DiskInfoItem = {
        //         capacity:item.
        //     }

        // }
    }
    IsReady: boolean;
github danelkhen / desktopbrowser / server / out / utils / io.js View on Github external
static async GetDrives4() {
        const drives = await drivelist.list();
        return drives;
        // const list:DiskInfoItem[] = []
        // for(const drive of drives){
        //     const item:DiskInfoItem = {
        //         capacity:item.
        //     }
        // }
    }
}
github tingbot / tide-electron / app / wifisetup / index.html View on Github external
function checkForSD() {
      if (!sdCardCallback) return;

      const drivelist = require('drivelist');

      drivelist.list(function(error, disks) {
        if (error) throw error;
        console.log({disks});

        disks.forEach(function (disk) {
          if (disk.mountpoint) {
            const mountpoints = disk.mountpoint.split(',');

            mountpoints.forEach(function (mountpoint) {
              const sentinel = path.join(mountpoint, '.tingbot');

              fs.exists(sentinel, function (exists) {
                if (exists) {
                  if (!sdCardCallback) return;

                  sdCardCallback(mountpoint);
                  stopLookingForSD();
github jakoblo / ufo / src / js / navbar / navbar-actions.js View on Github external
return function(dispatch: Function, getState: Function) {
    drivelist.list((error, drives) => {
      if (error) {
        throw error;
      }
      dispatch(drivesSet(drives));
    });

    driveScanner = new DrivelistWatcher({
      callbackDeviceAdded: drives => {
        dispatch(drivesSet(drives));
      },
      callbackDeviceRemoved: drives => {
        dispatch(drivesSet(drives));
      },
      intervalTime: 5000
    });
  };
github davidferguson / pibakery / lib / sdcard.js View on Github external
function getSDs (cb) {
  drivelist.list(function (error, drives) {
    if (error) {
      cb(error, false)
      return
    }

    var sdCards = []
    for (var i = 0; i < drives.length; i++) {
      var currentDrive = drives[i]
      if (!currentDrive.system && !currentDrive.protected) {
        currentDrive.name = getDriveName(currentDrive)
        if (currentDrive.name) {
          sdCards.push(currentDrive)
        }
      }
    }
github balena-io / etcher / lib / sdk / writer / index.js View on Github external
getSelectedDevices (paths, callback) {
    debug('state:device-select', paths)
    drivelist.list((error, drives) => {
      debug('state:device-select', paths, error ? 'NOT OK' : 'OK')

      if (error) {
        callback.call(this, error)
        return
      }

      const results = paths.map((path) => {
        const destination = {
          fd: null,
          error: null,
          stream: null,
          finished: false,
          verified: false,
          device: _.find(drives, {
            device: path

drivelist

List all connected drives in your computer, in all major operating systems

Apache-2.0
Latest version published 8 months ago

Package Health Score

66 / 100
Full package analysis

Popular drivelist functions