https://github.com/joecohens/electron-first-run
Check if it's the first time an Electron App runs
https://github.com/joecohens/electron-first-run
electron storage
Last synced: about 1 year ago
JSON representation
Check if it's the first time an Electron App runs
- Host: GitHub
- URL: https://github.com/joecohens/electron-first-run
- Owner: joecohens
- License: mit
- Created: 2018-08-10T23:41:47.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-07T04:04:43.000Z (almost 6 years ago)
- Last Synced: 2025-03-27T21:02:08.814Z (about 1 year ago)
- Topics: electron, storage
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 15
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# electron-first-run
[](https://travis-ci.org/joecohens/electron-first-run) [](https://ci.appveyor.com/project/joecohens/electron-first-run/branch/master)
Check if it's the first time an Electron App runs.
This pacakge it's based on [first-run](https://github.com/sindresorhus/first-run) by [@sindresorhus](https://github.com/sindresorhus), keeping the API as a drop in replacement for Electron.
## Install
```
$ npm install --save electron-first-run
or
$ yarn add --save electron-first-run
```
## Usage
```js
// main process
const firstRun = require('electron-first-run');
const isFirstRun = firstRun()
console.log(isFirstRun);
```
## API
### firstRun([options])
#### options.name
Type: `string`
Default: `electron-app-first-run`
Name of the storage file (without extension).
This is useful if you want multiple storage files for your app. Or if you're making a reusable Electron module that persists some data, in which case you should not use the default name.
### firstRun.clear()
Clear the state.
## License
MIT © [Joseph Cohen](http://joecohens.com)