Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including grunt-mount with all npm packages installed. Try it out:

require("grunt/package.json"); // grunt is a peer dependency. var gruntMount = require("grunt-mount")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

grunt-mount v0.2.5

grunt task to mount a network share

grunt-mount Build Status NPM version Dependencies

Grunt task to mount/unmount a network share

Provides two tasks: mount and unmount.

Installation

npm install --save-dev grunt-mount

Configuration

grunt.initConfig({
  mount: {
    share: {
      options: {
        windows: {                      // windows specific options
          driveLetter: "X"
        },
        '*nix': {                       // *nix specific options
          fileSystem: "smbfs",          // equivalent to 'mount -t [smbfs|cifs|nfs]'
        },
        share: {
          host: "my.server.com",
          folder: "/path/on/server"     // paths can be windows or *nix style (will be normalised)
        },
        mountPoint: "./share",          // path to mount the share (can be windows or unix style)
        username: "someuser",
        password: "password"
      }
    }
  },
  unmount: {
    share: {
      options: {
        windows:{                    // windows specific options
          driveLetter: "X"
        },
        mountPoint: "./share"
      }
    }
  }
});

grunt.loadNpmTasks('grunt-mount');

On *nix systems, the share will be mounted at the specified mount-point. On Windows, the share will be mounted on the specified drive letter, and a symlink will be created at the mount-point.

Limitations:

  • Only works for Linux, MacOS and Windows (FreeBSD and SunOS coming)
  • Must specify a drive letter for Windows
  • MountPoint must be relative path in order for Windows compatibility
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free