GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ryyppy/node-mount: Mount devices with node.js like what

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

39 Commits
39 Commits

Folders and files

NameName
Last commit message
Last commit date
test
test
 
 
.gitignore
.gitignore
 
 
.jshintrc
.jshintrc
 
 
.tern-project
.tern-project
 
 
Gruntfile.js
Gruntfile.js
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
binding.gyp
binding.gyp
 
 
mount.cc
mount.cc
 
 
mount.js
mount.js
 
 
package.json
package.json
 
 

Repository files navigation

node-mount

Mount/umount devices from node.js

Really works on linux, may work on OS X, and will never work on windows.

##Difference to the original version?

  • True asynchronous mount call, so it will not block the whole application if my DVD is scratched and takes ages to mount
  • Corrected terms... "unmount" was renamed to "umount" (equal to the C-API)
  • More flag options (noexec)
  • Node-like error-callback to report the original error-code of the C-API
  • More detailed documentation
  • Some small tests

##Installation This package is not featured in NPM, so you have to add this file in your package.json file:

Part of package.json:

{
    "name" : "myproject",
    "version" : "1.0",
    ...
    ...
    "dependencies" : {
        "mount" : "git+ssh://[email protected]:magicpat/node-mount.git"
    }
}

Syntax

mount

mount(devFile, target, fsType, options, data)
  • devFile - {String} - Device-File being mounted (located in /dev)
  • target - {String} - Directory to mount the device to
  • options - {String[]} - Array containing String options (see reference list)

options These (limited number of) options are equivalent to the mountflags parameter used by the C mount function (http://man7.org/linux/man-pages/man2/mount.2.html). Following options are available:

  • bind
  • readonly
  • remount
  • noexec

umount

umount(target)
  • target - {String} - Target path to umount (equivalent to target of mount)

Usage

Mount Tmpfs:

var mount = require("mount");
mount.mount('tmpfs', 'tmpDir', 'tmpfs', function(err) {
	if(err){
        return;
    }
    //Tmpfs mounted successfully
});

Mount DVD:

var mount = require("mount");
mount.mount('/dev/sr0', 'myDir', 'iso9660', function(err) {
    if(err){
        return;
    }

    //
});

Umount after successful mount:

var mount = requrie("mount");
mount.umount('myDir', function(err) {
    if(err){
        console.log("Umount went wrong: " + err);
        return;
    }

});

Credits

  • Directly forked from Stackdot`s repository
  • Stackdot forked this from Maciej Małecki`s repository

About

Mount devices with node.js like what

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.