{"id":13798130,"url":"https://github.com/arboleya/electrify","last_synced_at":"2025-04-09T21:14:48.809Z","repository":{"id":57221464,"uuid":"38968932","full_name":"arboleya/electrify","owner":"arboleya","description":"Package your Meteor apps with Electron, and butter","archived":false,"fork":false,"pushed_at":"2016-08-30T09:34:13.000Z","size":400,"stargazers_count":247,"open_issues_count":34,"forks_count":52,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-09T21:14:40.471Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arboleya.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-12T16:31:50.000Z","updated_at":"2024-01-30T20:13:17.000Z","dependencies_parsed_at":"2022-08-29T02:12:51.350Z","dependency_job_id":null,"html_url":"https://github.com/arboleya/electrify","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arboleya%2Felectrify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arboleya%2Felectrify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arboleya%2Felectrify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arboleya%2Felectrify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arboleya","download_url":"https://codeload.github.com/arboleya/electrify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111971,"owners_count":21049578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:00:39.381Z","updated_at":"2025-04-09T21:14:48.788Z","avatar_url":"https://github.com/arboleya.png","language":"JavaScript","readme":"# Electrify [![windows](https://img.shields.io/appveyor/ci/arboleya/electrify.svg?label=windows)](https://ci.appveyor.com/project/arboleya/electrify) [![travis](https://img.shields.io/travis/arboleya/electrify/master.svg?label=osx/linux)](https://travis-ci.org/arboleya/electrify) [![coverage](https://img.shields.io/codeclimate/coverage/github/arboleya/electrify.svg)](https://codeclimate.com/github/arboleya/electrify/coverage) [![join the chat at https://gitter.im/arboleya/electrify](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/arboleya/electrify)\n\nEasily package your Meteor apps with Electron, and *butter*.\n\n## TL;DR\n\n````shell\nnpm install -g electrify\ncd /your/meteor/app\nelectrify\n````\n## Compatibility\n\nWorks on all Meteor's supported [platforms](https://github.com/meteor/meteor/wiki/Supported-Platforms).\n\n## Help\n\n````bash\n$ electrify -h\n\n  Usage: electrify [command] [options]\n\n  Commands:\n\n    run       (default) start meteor app within electrify context\n    bundle    bundle meteor app at `.electrify` dir\n    package   bundle and package app to `--output` dir\n\n  Options:\n\n    -h, --help             output usage information\n    -V, --version          output the version number\n    -i, --input    \u003cpath\u003e  meteor app dir       | default = .\n    -o, --output   \u003cpath\u003e  output dir           | default = .electrify/.dist\n    -s, --settings \u003cpath\u003e  meteor settings file | default = null (optional)\n\n  Examples:\n\n    # cd into meteor dir first\n    cd /your/meteor/app\n\n    electrify\n    electrify run\n    electrify package\n    electrify package -o /dist/dir\n    electrify package -o /dist/dir -s file.json\n    electrify package -i /app/dir -o /dist/dir -s dev.json\n    electrify package -- \u003celectron-packager-options\u003e\n\n    # more info about electron packager options:\n    # ~\u003e https://www.npmjs.com/package/electron-packager\n````\n\n## Installation\n\n````shell\nnpm install -g electrify\n````\n\n\u003e For invoking Electron methods from Meteor, you'll also need to install the\n\u003e `arboleya:electrify` meteor package.\n\u003e For more info check [Meteor x Electron integration](#meteor-x-electron-integration).\n\n## Running app\n\n````shell\ncd /your/meteor/app\nelectrify\n````\n\n## Packaging\n\n````shell\ncd /your/meteor/app\nelectrify package\n````\n\nThe packaging process is done under the hood using `electron-packager`\nnpm package. The following variables are automatically set:\n\n  * `--out` -- *comes from cli option [-o, --out]*\n  * `--arch` -- *comes from system [current arch]*\n  * `--platform` -- *comes from system [current platform]*\n  * `--version` -- *comes from .electrify/package.json [current app version]*\n\nYou can overwrite these default values and also set others by passing custom\narguments directly to `electron-packager` after `--`, i.e:\n\n````shell\ncd /your/meteor/app\nelectrify package -- --icon=/folder/x/img/icon.png --version=x.y.z\n````\n\nAll the available options for `electron-packager` can be found here:\nhttps://www.npmjs.com/package/electron-packager\n\n### Notes\n\nThe output app will match your current operational system and arch type.\n\n  * To get an **OSX** app, run it from a **Osx** machine.\n  * To get an **Linux 32bit** app, run it from a **32bit Linux** machine.\n  * To get an **Linux 64bit** app, run it from a **64bit Linux** machine.\n  * To get an **Windows 32bit** app, run it from a **32bit Windows** machine.\n  * To get an **Windows 64bit** app, run it from a **64bit Windows** machine.\n\nDue to NodeJS native bindings of such libraries such as Fibers -- *which are\nmandatory for Meteor*, you'll need to have your Meteor app fully working on the\ndesired platform before installing this plugin and packaging your app.\n\nSo, at this time, you cannot package your app in a cross-platform fashion from\none single OS.\n\nPerhaps you can live with it? :)\n\n\u003e **DO NOT** use options to output for multiple arch/platforms at once, such as\n`--arch=all`. It won't work, Electrify can bundle Meteor apps only for the\nplatform you're running on.\n\n\n## Options\n\n1. `-i, --input` - Meteor app folder, default is current directory (`process.cwd()`).\n1. `-o, --output` - Sets output folder for your packaged app, default is\n`/your/meteor/app/.dist`\n1. `-s, --settings` Sets path for Meteor\n[settings](http://docs.meteor.com/#/full/meteor_settings) file, this will be\navailable inside your Meteor code both in development and after being packaged.\n\n## Structure\n\nYou'll notice a new folder called `.electrify` in your meteor app dir, its\nstructure will be like this:\n\n````\n/your/meteor/app\n├── .electrify\n│   ├── .gitignore\n│   ├── electrify.json\n│   ├── index.js\n│   └── package.json\n├── .meteor\n└── ...\n````\n\nThis is a pure Electron project, so you can use the whole Electron API from JS\nfiles in this folder. Also, you can install electron dependencies and store them\nin the `package.json` file. Note that the `electrify` package is itself a\ndependency.\n\nSee this folder as the `desktop layer` for your Meteor app. Remember to check\nout the `index.js` file, it constains the electrify start/stop usage.\n\nThe `electrify.json` file will hold specific preferences for Electrify, such as\nplugins and so on. It's still a WIP, but you can get around it.\n\n### Config (`electrify.json`)\n\nFor now there's only one option here: `preserve_db`.\n\nSet it to true to preserve database between installs. It works by saving the\nmongo data dir inside user's data folder, instead of being self contained within\nthe app folder (which gets deleted when new version is installed).\n\n# Customizing\n\nLet's see how one would be able to do a simple SplashScreen:\n\n````javascript\nvar app       = require('app');\nvar browser   = require('browser-window');\nvar electrify = require('electrify')(__dirname);\n\nvar window = null;\nvar splash = null; // splash variable\n\napp.on('ready', function() {\n  splash = new browser({ // starts splash window\n    // \u003e\u003e\u003e your configs here\n  });\n  splash.loadUrl('./splash.html'); // create the \".electrify/splash.html\" file\n  \n  // then move along and start electrify\n  electrify.start(function(meteor_root_url) {\n\n    // before opening a new window with your app, destroy the splash window\n    splash.close(); // \u003e\u003e\u003e or .destroy(), check what works for you\n\n\n    // from here on, well, nothing changes..\n\n\n    window = new browser({\n      width: 1200, height: 900,\n      'node-integration': false // node integration must to be off\n    });\n    window.loadUrl(meteor_root_url);\n  });\n});\n\n\n// ....\n\n````\n\n## Meteor x Electron integration\n\nYou can seamlessly call Electron methods from your Meteor's client/server code.\n\nDefine your Electron methods inside the `.electrify` folder:\n\n````javascript\n// `.electrify/index.js` file\nelectrify.methods({\n  'hello.world': function(firstname, lastname, done) {\n    // do things with electron api, and then call the `done` callback\n    // as ~\u003e done(err, res);\n    done(null, 'Hello '+ firstname +' '+ lastname +'!');\n   }\n});\n````\n\nThen, in your Meteor code (client and server), you can call this method like:\n\n````javascript\n// Electrify.call(method_name, args, done_callback);\nElectrify.call('hello.world', ['anderson', 'arboleya'], function(err, msg) {\n  console.log(msg); // Hello anderson arboleya!\n});\n````\n\n\u003e **IMPORTANT**\n\u003e \n\u003e You can only call methods after the connection is made between Meteor and\n\u003e Electron, to make sure it's ready you can wrap your code in a startup block:\n\u003e \n\u003e ````javascript\n\u003e Electrify.startup(function(){\n\u003e   Electrify.call(...);\n\u003e });\n\u003e ````\n\n## Upgrading\n\nWhen upgrading to newer versions, it's **important** to know that:\n\n### ~\u003e templates\n\nOnce these files exists on disk, they *will not* be overwritten.\n * `.electrify/index.js`\n * `.electrify/package.json`\n * `.electrify/electrify.json`\n * `.electrify/.gitignore.json`\n\n### ~\u003e api\n\nAs these files above is never overwritten, in case of any API change that needs\nadjustments, these will have to be made manually.\n\n### ~\u003e version matching\n\nAlways keep the same electrify version in your Meteor, and inside the\n`.electrify` folder, *as per specified in `.electrify/package.json` file*.\n\n## Questions?\n\nDo not open issues, use the chat channel instead.\n\n[![Join the chat at https://gitter.im/arboleya/electrify](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/arboleya/electrify)\n\n## Problems?\n\nThis is very young and active software, so make sure your are always up to date\nbefore opening an issue. Follow the released fixes through the\n[HISTORY.md](HISTORY.md) file.\n\nIf you find any problem, please open a meaningful issue describing in detail how\nto reproduce the problem, which platform/os/arch type you're using, as well as\nthe version of Meteor and Electrify, and any other info you may find usefull.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 Anderson Arboleya","funding_links":[],"categories":["Library","Tools"],"sub_categories":["Packager/Installer","For Electron"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farboleya%2Felectrify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farboleya%2Felectrify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farboleya%2Felectrify/lists"}