{"_id":"-temp-electron-manager-somiibo","name":"-temp-electron-manager-somiibo","dist-tags":{"latest":"0.0.200"},"versions":{"0.0.200":{"name":"-temp-electron-manager-somiibo","version":"0.0.200","description":"An NPM module with tools, helper functions, and utilities for building a flawless Electron app 🚀","main":"dist/index.js","bin":{"electron-manager":"bin/electron-manager","electronmanager":"bin/electron-manager","eman":"bin/electron-manager"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","start":"node ./src/cli.js"},"engines":{"node":">=6.0.0"},"author":{"name":"ITW Creative Works"},"license":"MIT","keywords":["root","electron","path","front-end"],"repository":{"type":"git","url":"git+https://github.com/itw-creative-works/electron-manager.git"},"bugs":{"url":"https://github.com/itw-creative-works/electron-manager/issues"},"homepage":"https://itwcreativeworks.com","dependencies":{"@octokit/rest":"^18.12.0","@sentry/electron":"^2.5.4","auto-launch":"^5.0.5","chalk":"^4.1.2","electron-is-dev":"^2.0.0","electron-is-packaged":"^1.0.2","electron-is-snap":"^1.0.3","electron-log":"^4.4.8","electron-rebuilder":"^0.0.20","electron-store":"^8.1.0","fs-jetpack":"^4.3.1","glob":"^7.2.3","json5":"^2.2.1","jszip":"^3.10.1","keychain":"^1.3.0","lodash":"^4.17.21","macaddress":"^0.5.3","mime-types":"^2.1.35","moment":"^2.29.4","node-powertools":"^0.0.21","original-fs":"^1.2.0","promo-server":"^0.0.24","semver":"^7.3.8","simple-plist":"^1.3.1","universal-analytics":"^0.5.3","uuid":"^8.3.2","web-manager":"^3.1.7","wonderful-fetch":"^0.0.14","yaml":"^1.10.2","yargs":"^17.6.0"},"peerDependencies":{"electron-builder":"23.3.3","electron-notarize":"^1.2.1","electron-notarize-dmg":"^1.0.0","electron-updater":"5.2.1"},"gitHead":"334719a8a8bc0d58821a39f7a8c0137f4212ed4c","_id":"-temp-electron-manager-somiibo@0.0.200","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-I2iUt4mcwce9SLlvv8QGcAt8fTMwOud0znayC5N5YRE68aRjZ+IOuwN+BsWw17mbYwDjXALgrG8ufIWdqW1qgQ==","shasum":"544f4239a50442a3134494f0c44f37f5cbeb7fa1","tarball":"https://registry.npmjs.org/-temp-electron-manager-somiibo/-/-temp-electron-manager-somiibo-0.0.200.tgz","fileCount":61,"unpackedSize":329459,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFxytifUjD2dlPcbhzIxRKLfTFj690RoVd14qT1oLmkRAiAzBj2kJMtqub2WcHu7uSIGh+5J4uUi+mjpKWMyYfBqKw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjR2I6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqc/BAAmtFwTHswx9mSKQ6/DtPeNZCfeX92J/FGCUhXibfkJ0y3USrV\r\nOcKWDa/hU90UnOFyPGZaAvMSLZHl336FbegeQUf0+1xeA1jeyMQjYVDLV3pD\r\nViaUTa1ezuMBWIQ2/cRlAnpB7EXM69H5oKXMlqiCkWyD7Etl3IHRwdVOg6F5\r\nBal0VgNBcIyLFbCzBAcnGQlVUKbpEFpVVmbQg2YYb3otmCX3KyqIg9EjcC9Z\r\ngy7w85055c/nayJAF/39hHJMT4r5JckNIUJiMiL64abUxxTTiXGrFCDa8GQU\r\ntsUg6YICx3RF9kG+5CUhf9opKisCmzMUeH3+Kelnqaf0lX770yKsunGEHIz8\r\nWKdukjvhpjOfkLH6Ct89Els46/OoAeILwf5DRAT+0DHhL5P2soiA5jdHD3SO\r\nlJit6n6APP4QLggISI7x8p8kSBi3ii/NJCJGDumRCDgkO1r1MCnYG+bbLoDm\r\nwLbZoEAQKAkpGUJ96AuyDfkC79CKgWyUNT8C7Ro7ckadf+GM5CK5DsoqfPTE\r\np4mCWK/GwBtt63lqCMdV1+Ji2qAk/k5KUNnVuPQDcwpqqI6AhZHTYbmEsTvX\r\n80I6Elck/qv4g1coVlYgQ7/8JNB/MuM+uIsRdkqFOZzoymT3MNQpiJz3j6Dm\r\nGkaSeSJiKQHncV3J8VTNB/mnUUhPItOsYaA=\r\n=DQr5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"itwcw2000","email":"itw.creative.works@gmail.com"},"directories":{},"maintainers":[{"name":"itwcw2000","email":"itw.creative.works@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/-temp-electron-manager-somiibo_0.0.200_1665622586276_0.8269836588673847"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-13T00:56:26.275Z","0.0.200":"2022-10-13T00:56:26.519Z","modified":"2022-10-13T00:56:26.656Z"},"maintainers":[{"name":"itwcw2000","email":"itw.creative.works@gmail.com"}],"description":"An NPM module with tools, helper functions, and utilities for building a flawless Electron app 🚀","homepage":"https://itwcreativeworks.com","keywords":["root","electron","path","front-end"],"repository":{"type":"git","url":"git+https://github.com/itw-creative-works/electron-manager.git"},"author":{"name":"ITW Creative Works"},"bugs":{"url":"https://github.com/itw-creative-works/electron-manager/issues"},"license":"MIT","readme":"<p align=\"center\">\n  <a href=\"https://cdn.itwcreativeworks.com/assets/itw-creative-works/images/logo/itw-creative-works-brandmark-black-x.svg\">\n    <img src=\"https://cdn.itwcreativeworks.com/assets/itw-creative-works/images/logo/itw-creative-works-brandmark-black-x.svg\">\n  </a>\n</p>\n\n<p align=\"center\">\n  <img src=\"https://img.shields.io/github/package-json/v/itw-creative-works/electron-manager.svg\">\n  <br>\n  <img src=\"https://img.shields.io/librariesio/release/npm/electron-manager.svg\">\n  <img src=\"https://img.shields.io/bundlephobia/min/electron-manager.svg\">\n  <img src=\"https://img.shields.io/codeclimate/maintainability-percentage/itw-creative-works/electron-manager.svg\">\n  <img src=\"https://img.shields.io/npm/dm/electron-manager.svg\">\n  <img src=\"https://img.shields.io/node/v/electron-manager.svg\">\n  <img src=\"https://img.shields.io/website/https/itwcreativeworks.com.svg\">\n  <img src=\"https://img.shields.io/github/license/itw-creative-works/electron-manager.svg\">\n  <img src=\"https://img.shields.io/github/contributors/itw-creative-works/electron-manager.svg\">\n  <img src=\"https://img.shields.io/github/last-commit/itw-creative-works/electron-manager.svg\">\n  <br>\n  <br>\n  <a href=\"https://itwcreativeworks.com\">Site</a> | <a href=\"https://www.npmjs.com/package/electron-manager\">NPM Module</a> | <a href=\"https://github.com/itw-creative-works/electron-manager\">GitHub Repo</a>\n  <br>\n  <br>\n  <strong>Electron Manager</strong> is an NPM module for Electron developers with tools, helper functions, and utilities for building a flawless Electron app 🚀\n</p>\n\n## Install\nInstall with npm:\n```shell\nnpm install electron-manager\n```\n**Note**: This module requires a peer dependency of Electron. The required version can be found in the package.json.\n\n## Features\n* Correctly handles a **ton** of things that Electron falls short on in cross-platform cases like: `setAsDefaultProtocolClient`, `getApplicationNameForProtocol`, `isDefaultProtocolClient`, and more\n* Provides a simple cross-platform method to set your app to **auto launch** at startup (Includes Windows Store and some Linux distros)\n* Provides an easy cross-platform method to set your app as the **default browser**\n\n## Example Setup\nAfter installing via npm, simply `require` the library and begin enjoying this simple tool 🧰.\n```js\n// In your main.js file\nconst Manager = new (require('electron-manager'))({\n  appName: 'Electron',\n  appId: 'electron',\n})\n```\n### Options\n  * `appName`: This should be the name of your app and what end users would see, such as `Electron.`\n    * The `appName` is used to get/set things on **Windows** so it should be whatever your `Applications\\\\*.exe` file's name is.\n  * `appId`: This should be the id of your app such as `electron.`\n    * The `appId` is used to get/set protocols on **Linux** so it should be whatever your `*.desktop` file's name.\n\n### Properties\n  * `environment`: Can be either `development` or `production` (uses `electron-is-dev`).\n  * `isLinux`: Will be true if your app is running on **Linux**.\n  * `isSnap`: Will be true if your app is running as a **Linux Snap** (uses `electron-is-snap`).\n  * `storeName`: Can be either `mac`, `windows`, `snap`, or `none`.\n\n## .app() Library\nThis library practically replaces some methods of Electron's `app` API. You don't need to use these and the original APIs as these methods can replace the existing ones.\n\n### .app().setAsDefaultProtocolClient(protocol, options)\nCorrectly sets your app as the default handler for a `protocol`. Calls `xdg-mime default` and `xdg-settings set` under the hood which Electron fails to do for **Linux**.\n```js\nawait Manager.app().setAsDefaultProtocolClient('electron');\n\n// Output: null (for now)\n```\n\n### .app().getApplicationNameForProtocol(protocol)\nCorrectly gets the app name that handles a `protocol`. Protocol must include `://` just like normal. Calls `xdg-settings get default-url-scheme-handler` under the hood which Electron fails to do for **Linux**.\n```js\nawait Manager.app().getApplicationNameForProtocol('electron');\n\n// Output: String\n```\n\n### .app().isDefaultProtocolClient(protocol, options)\nCorrectly checks whether your app is the default handler for a `protocol`. Calls `xdg-settings get default-url-scheme-handler` under the hood which Electron fails to do for **Linux**.\n```js\nawait Manager.app().isDefaultProtocolClient('electron');\n\n// Output: Boolean\n```\n\n### .app().setLoginItemSettings(options)\nThis is how you get an **auto-launching** app!. Automatically adds a super helpful flag: `--was-opened-at-login=\"true\"`.\n\nThe only distros this doesn't seem to work on are **MAS** and **Linux Snap**. RIP.\n```js\nawait Manager.app().setLoginItemSettings({\n  openAtLogin: true,\n});\n\n// Output: null (for now)\n```\n\n### .app().setAsDefaultBrowser(options)\nCorrectly sets your app as a default browser for every platform. Yes, even on **Windows**!.\n```js\nawait Manager.app().setAsDefaultBrowser();\n\n// Output: null (for now)\n```\n\n**Note**: If you want to do this on Windows, you need to somehow distribute a helper executable called [SetUserFTA](http://kolbi.cz/blog/2017/10/25/setuserfta-userchoice-hash-defeated-set-file-type-associations-per-user/) and then supply the path to this in the option `setUserFTAPath`. This option has no effect on other platforms since other platforms work more easily.\n\n```js\nconst { app } = require('electron');\nconst path = require('path');\nconst appDataPath = path.resolve(app.getPath('appData'), 'set-user-fta.exe')\nawait Manager.app().setAsDefaultBrowser({\n  setUserFTAPath: appDataPath,\n});\n\n// Output: null (for now)\n```\n\n### .app().isDefaultBrowser(options)\nCorrectly returns whether your app is the default browser on any platform.\n```js\nawait Manager.app().isDefaultBrowser();\n\n// Output: Boolean\n```\n\n### .app().wasOpenedAtLogin(options)\nCorrectly returns whether your app was opened at login. Remember that `--was-opened-at-login=\"true\"` flag we set earlier when we called `await Manager.app().setLoginItemSettings()`? Wow this is so **easy**!.\n```js\nawait Manager.app().wasOpenedAtLogin();\n\n// Output: Boolean\n```\n\n**Note**: Before you get your hopes *too* high, there's **no way** to set or get the `--was-opened-at-login=\"true\"` flag on **Linux** or **Windows Store** yet. To compensate, this method will check to see if the app was opened within `120` seconds of the OS booting up or the user logging in. Thus, it's best to call this as early as possible in your app.\n\nIt's by no means a perfect solution but it will work 90% of the time. You can change the `threshold` to whatever seconds you want:\n\n```js\nawait Manager.app().wasOpenedAtLogin({\n  threshold: 60, // Don't go too low (most people have slow-ass computers)\n});\n\n// Output: Boolean\n```\n\n## Default DOM operations\n* `brand-name-element`: Set to `productName` in `package.json`\n* `app-id-element`: Set to `name` in `package.json`\n* `current-version-element`: Set to `version` in `package.json`\n* `current-year-element`: Set to **the current year**\n* `manager-initialized-element`: Removed when `ElectronManager` finishes initializing.\n* `upgrade-account-btn`: Enabled if `user.plan.id` === `basic`\n\n## App arguments\nUse arguments like `npm start -- --name=\"value\"` to test and streamline your development\n* `--useDevelopmentURLs=\"true\"` (`true`): Will use localhost:4000 instead of live URLS\n  * Can be `true` or `false`\n* `--enableLiveSentry=\"false\"` (`false`): Will actually send errors to Sentry if `true`\n  * Can be `true` or `false`\n* `--was-opened-at-login=\"false\"` (`false`): Change **Electron Manager**'s behavior for handling if the app was opened at login.\n  * Can be `true` or `false`\n* `--devUpdateStatus=\"available\"` (`available`): Change the `electron-updater` flow.\n  * Can be `available`, `unavailable`, or `error`\n\n## Other libraries and features\nThis is just the beginning. More great features and fixes will be coming soon\n\n## Final Words\nIf you are still having difficulty, we would love for you to post a question to [the Electron is Snap issues page](https://github.com/itw-creative-works/electron-manager/issues). It is much easier to answer questions that include your code and relevant files! So if you can provide them, we'd be extremely grateful (and more likely to help you find the answer!)\n\n## Projects Using this Library\n[Somiibo](https://somiibo.com/): A Social Media Bot with an open-source module library. <br>\n[JekyllUp](https://jekyllup.com/): A website devoted to sharing the best Jekyll themes. <br>\n[Slapform](https://slapform.com/): A backend processor for your HTML forms on static sites. <br>\n[Sniips](https://sniips.com/): A modern, hackable snippet manager <br>\n[Proxifly](https://proxifly.com/): An API to get free proxies for your services. <br>\n[Optiic](https://optiic.dev/): A free OCR image processing API. <br>\n[SoundGrail Music App](https://app.soundgrail.com/): A resource for producers, musicians, and DJs. <br>\n\nAsk us to have your project listed! :)\n\n## Other Great Libraries\n[node-powertools](https://www.npmjs.com/package/node-powertools): An NPM module for backend and frontend developers that exposes powerful utilities and tools. <br>\n[electron-is-snap](https://www.npmjs.com/package/electron-is-snap): An NPM module for checking if your app is running in a snap environment <br>\n[optiic](https://www.npmjs.com/package/optiic): An OCR image processing API. <br>\n[proxifly](https://www.npmjs.com/package/proxifly): An API to find proxies for your apps. <br>\n[slapform](https://www.npmjs.com/package/slapform): A form backend API. <br>\n","readmeFilename":"README.md"}