mac-network-drive
Allows you to list/find/(un)mount network drives on macOS from Node.JS
Last updated 3 years ago by fllorent0d .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mac-network-drive 
SYNC missed versions from official npm registry.

mac-network-drive

Port on Mac of windows-network-drive package.

Installation

npm install mac-network-drive

Usage

All examples assume:

let networkDrive = require('mac-network-drive');

find

find(drivePath: string): Promise<string | undefined>

Examples

 networkDrive.find("\\DoesExist\Path")
 .then(function (path)
 {
	 // path === "/Volumes/"
 });

 networkDrive.find("\\\\DoesNOTExist\Path")
 .then(function (path)
 {
	 // path === undefined
 });

list

list(void): Promise<Object>

Examples

 networkDrive.list()
 .then(function (drives)
 {
	 /*
		drives = {
			"/Volumes/...":"\\DoesExist\Path\Files",
			"/Volumes/...":"\\NETWORKB\\DRIVE C"
		}
	*/
 });

mount

mount(drivePath: string, undefined, username?: string, password?: string): Promise<string>

The second param is useless. I kept it to have the same amount of parameters that the windows package.

Examples

 networkDrive.mount("\\\\DoesExist\\Path\\Files", undefined, undefined, undefined)
 .then(function (path)
 {
	 // path = "/Volumes/xxx"
 });

unmount

Not implemented yet

Tests

npm test

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Format code with VS Code. Add unit tests for any new or changed functionality. Lint and test your code.

Current Tags

  • 1.0.1                                ...           latest (3 years ago)

2 Versions

  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |