index.js
function init (root, storage) {
  // calling path
  const calling = path.dirname(getCallingScript())

  // root path
  root = !root || root === '.' || root === './'
    ? root = calling
    : path.isAbsolute(root)
      ? root
      : path.normalize(calling + root)
  sketchpad.root = root.replace(/\/*$/, '/')

  // settings path
  const settingsFolder = path.normalize(sketchpad.root + (storage || 'storage') + '/sketchpad/')
  settingsFile = settingsFolder + 'settings.json'

  // check for settings
  if (!fs.existsSync(settingsFolder)) {
    return error('Folder "' +settingsFolder+ '" not found')
  }
  if (!fs.existsSync(settingsFile)) {
    return error('File "settings.json" not found in "' +settingsFolder+ '"')
  }

  // load settings
  sketchpad.load()
  return this
}
function init (root, storage) {
  // calling path
  const calling = path.dirname(getCallingScript())

  // root path
  root = !root || root === '.' || root === './'
    ? root = calling
    : path.isAbsolute(root)
      ? root
      : path.normalize(calling + root)
  sketchpad.root = root.replace(/\/*$/, '/')

  // settings path
  const settingsFolder = path.normalize(sketchpad.root + (storage || 'storage') + '/sketchpad/')
  settingsFile = settingsFolder + 'settings.json'

  // check for settings
  if (!fs.existsSync(settingsFolder)) {
    return error('Folder "' +settingsFolder+ '" not found')
  }
  if (!fs.existsSync(settingsFile)) {
    return error('File "settings.json" not found in "' +settingsFolder+ '"')
  }

  // load settings
  sketchpad.load()
  return this
}
function init ( root , storage ) { // calling path const calling = path . dirname ( getCallingScript ( ) ) // root path root = ! root || root === '.' || root === './' ? root = calling : path . isAbsolute ( root ) ? root : path . normalize ( calling + root ) sketchpad . root = root . replace ( / \/*$ / , '/' ) // settings path const settingsFolder = path . normalize ( sketchpad . root + ( storage || 'storage' ) + '/sketchpad/' ) settingsFile = settingsFolder + 'settings.json' // check for settings if ( ! fs . existsSync ( settingsFolder ) ) { return error ( 'Folder "' + settingsFolder + '" not found' ) } if ( ! fs . existsSync ( settingsFile ) ) { return error ( 'File "settings.json" not found in "' + settingsFolder + '"' ) } // load settings sketchpad . load ( ) return this }
Initialize Sketchpad, optionally with non-standard paths

@param   {string}  [root]      Relative path to Laravel root folder
@param   {string}  [storage]   Relative path to storage folder from root
@returns {boolean}
Initialize Sketchpad optionally with non - standard paths