Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

electron-store-data

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electron-store-data

A Node.js module to store Electron data in the computer.

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

electron-store-data

npm license

A Node.js module to store Electron data in the computer.

Installation

# npm
npm i electron-store-data

# pnpm
pnpm add electron-store-data

# yarn
yarn add electron-store-data

Usage

// include module
const Store = require('electron-store-data')

// initialize
const storeWindow = new Store({
  filename: 'window', // will be window.json
  defaults: {
    bounds: { x: '', y: '', width: 900, height: 500 }
  }
})

// get
console.log(storeWindow.get('bounds'))
// { x: '', y: '', width: 900, height: 500 }

// set
storeWindow.set('bounds', { x: 500, y: 200, width: 800, height: 450 })

// delete
storeWindow.delete('bounds')

Encryption

// initialize
const storeSubscription = new Store({
  filename: 'subscription',
  encryption: {
    enable: true,
    salt: 'XXX',
    password: 'XXX',
    keylen: '', // optional (default: 32)
    algorithm: '' // optional (default: aes-256-cbc)
  },
  defaults: {
    plan: 'basic',
    license: 'XXXX-XXXX-XXXX-XXXX'
  }
})

Contribution

Feel free to contribute. Open a new issue, or make a pull request.

License

MIT

Keywords

electron

FAQs

Package last updated on 05 Apr 2025

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