lib/index.js
function create(upperdir, callback)
{
  var workdir = upperdir.split('/')
  var user    = workdir.pop()
  var workdir = workdir.join('/')+'/.workdirs/'+user

  mkdirp(workdir, '0100', function(error)
  {
    if(error && error.code !== 'EEXIST') return callback(error)

    // Craft overlayed filesystem
    var type   = 'overlay'
    var extras =
    {
      lowerdir: '/',
      upperdir: upperdir,
      workdir : workdir
    }

    utils.mkdirMount(upperdir, type, MS_NOSUID, extras, function(error)
    {
      if(error) return callback(error)

      var arr =
      [
        {
          path: upperdir+'/dev',
          flags: MS_BIND,
          extras: {devFile: '/tmp/dev'}
        },
        {
          path: upperdir+'/proc',
          flags: MS_BIND,
          extras: {devFile: '/proc'}
        },
        {
          path: upperdir+'/tmp',
          type: 'tmpfs',
          flags: MS_NODEV | MS_NOSUID
        }
      ]

      each(arr, mkdirMountInfo, callback)
    })
  })
}
function create(upperdir, callback)
{
  var workdir = upperdir.split('/')
  var user    = workdir.pop()
  var workdir = workdir.join('/')+'/.workdirs/'+user

  mkdirp(workdir, '0100', function(error)
  {
    if(error && error.code !== 'EEXIST') return callback(error)

    // Craft overlayed filesystem
    var type   = 'overlay'
    var extras =
    {
      lowerdir: '/',
      upperdir: upperdir,
      workdir : workdir
    }

    utils.mkdirMount(upperdir, type, MS_NOSUID, extras, function(error)
    {
      if(error) return callback(error)

      var arr =
      [
        {
          path: upperdir+'/dev',
          flags: MS_BIND,
          extras: {devFile: '/tmp/dev'}
        },
        {
          path: upperdir+'/proc',
          flags: MS_BIND,
          extras: {devFile: '/proc'}
        },
        {
          path: upperdir+'/tmp',
          type: 'tmpfs',
          flags: MS_NODEV | MS_NOSUID
        }
      ]

      each(arr, mkdirMountInfo, callback)
    })
  })
}
function create ( upperdir , callback ) { var workdir = upperdir . split ( '/' ) var user = workdir . pop ( ) var workdir = workdir . join ( '/' ) + '/.workdirs/' + user mkdirp ( workdir , '0100' , function ( error ) { if ( error && error . code !== 'EEXIST' ) return callback ( error ) // Craft overlayed filesystem var type = 'overlay' var extras = { lowerdir : '/' , upperdir : upperdir , workdir : workdir } utils . mkdirMount ( upperdir , type , MS_NOSUID , extras , function ( error ) { if ( error ) return callback ( error ) var arr = [ { path : upperdir + '/dev' , flags : MS_BIND , extras : { devFile : '/tmp/dev' } } , { path : upperdir + '/proc' , flags : MS_BIND , extras : { devFile : '/proc' } } , { path : upperdir + '/tmp' , type : 'tmpfs' , flags : MS_NODEV | MS_NOSUID } ] each ( arr , mkdirMountInfo , callback ) } ) } ) }
Public API  
Execute the command file

@param {String}   upperdir Path of the root of the container
@param {Function} callback
Public API Execute the command file