Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-electron-storage

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-electron-storage

A vue plugin that attaches electron-storage APIs to the Vue object, making them accessible to all components.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

vue-electron-storage

A vue plugin that wraps electron-storage APIs to the Vue object.

js-standard-style

Installing

Install using NPM

npm install vue-electron-storage --save

Include using webpack or browserify

main.js

import Vue from 'vue'
import VueElectronStorage from 'vue-electron-storage'

Vue.use(VueElectronStorage)

Using the plugin

This plugin will attach electron-storage APIs to the Vue object itself, so accessing all APIs is dead simple. All official documentation from electron-storage can be used and accessed from this.$storage.

So instead of...

const storage = require('electron-storage')

export default {
  methods: {
    checkFileExists (path) {
      storage.isPathExists(path, (itDoes) => {
        if (itDoes) {
          console.log('pathDoesExists !')
        }
        return itDoes
      });
    }
  }
}

Now you can...

export default {
  methods: {
    checkFileExists (path) {
      this.$storage.isPathExists(path, (itDoes) => {
        if (itDoes) {
          console.log('pathDoesExists !')
        }
        return itDoes
      });
    }
  }
}

Now you might be thinking, "Is it really that annoying to simply require electron to access it?" Probably not, but it can get cumbersome to have to include it in every component file that needs it. In the end, attaching electron-storage directly to Vue just makes sense.

Keywords

FAQs

Package last updated on 29 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc