Skip to content

Fllorent0D/MacNetworkDriveJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

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.

About

Node.JS module to manage network drives on macOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published