We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var _, child_process, utils; _ = require('lodash'); child_process = require('child_process'); utils = require('./utils'); /** * @summary Unmount a device * @public * @function * * @description * It does nothing for Windows. * * @param {String} device - device path * @param {Function} callback - callback (error, stdout, stderr) * * @example * umount.umount '/dev/disk2', (error, stdout, stderr) -> * throw error if error? */ exports.umount = function(device, callback) { var unmountCommand; if (device == null) { throw new Error('Missing device'); } if (!_.isString(device)) { throw new Error("Invalid device: " + device); } if (callback == null) { throw new Error('Missing callback'); } if (!_.isFunction(callback)) { throw new Error("Invalid callback: " + callback); } if (utils.isWin32()) { return callback(null, null, null); } if (utils.isMacOSX()) { unmountCommand = '/usr/sbin/diskutil unmountDisk force'; } else { unmountCommand = 'umount'; } device = "\"" + device + "\""; if (utils.isLinux()) { device += '?* 2>/dev/null || /bin/true'; } return child_process.exec(unmountCommand + " " + device, callback); };
The text was updated successfully, but these errors were encountered:
'use strict'; const { blue, bold, green, red } = require('chalk'); const path = require('path'); const semver = require('semver'); const { exec } = require('child_process'); const { promisify } = require('util'); const execAsync = promisify(exec); async function getLatestVersions(name) { const { stdout } = await execAsync(`npm view ${name} versions --json`); try { return JSON.parse(stdout); } catch (err) { throw new Error(`Failed to parse output from NPM view - ${err.toString()}`); } }
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: