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

vue-electron-json-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-json-storage

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

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by133.33%
Maintainers
1
Weekly downloads
 
Created
Source

vue-electron-storage

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

js-standard-style

Installing

Install using NPM

npm install vue-electron-json-storage --save

Include using webpack or browserify

main.js

import Vue from 'vue'
import VueElectronJSONStorage from 'vue-electron-json-storage'

Vue.use(VueElectronJSONStorage)

Using the plugin

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

So instead of...

const storage = require('electron-json-storage')

export default {
  methods: {
    getName () {
      storage.get('name', (err, data) => {
        if (err) {
          console.error(err)
        } else {
          console.log(data)
        }
      })
    }
  }
}

Now you can...

export default {
  methods: {
    getName () {
      this.$storage.get('name', (err, data) => {
        if (err) {
          console.error(err)
        } else {
          console.log(data)
        }
      })
    }
  }
}

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-json-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