Electron ports HTML web applications to native applications for a range of devices, including creating native desktop applications. It's also very easy to get started!
To begin, we must have
meteor installed. Familiarity with these tools is vital for working with Meteor, so make sure you know about these things first.
npm install -g electrify
electronis what we're using! Read more here.
electrifyis a tool for packaging Meteor apps. Read mode here.
Other requirements for installing and using Electrify with Meteor
curl https://install.meteor.com/ | sh
There are many ways to install Meteor, see here.
apt-get install nodejs build-essentials
There are many ways to install, depending on your OS. Find out which way you need here.
npm should be bundled with the
nodejs installation. Check it is by running the command
npm -v after installing
npmis the Node Package Manager. It's a huge collection of open source modules that you can easily add into your Node projects. Read more here.
Let's download a Meteor Todos example project, using a Linux shell (command line) script, to test out Electrifying a project for the first time:
Requirements for this section:
apt-get install git-all
There are many ways to install Git. Check them out here.
gitis a version control system for files. They can be stored remotely (i.e., online) in public repositories (GitHub being a rather famous one) or private repositories (BitBucket provides limited free private repositories, as an example). Read more [here].
#!/usr/bin/bash # Change this parameter to choose where to clone the repository to. TODOSPATH="/home/user/development/meteor-todos" # Download the repository to the $TODOSPATH location. git clone https://github.com/meteor/todos.git "$TODOSPATH" # Change directory (`cd`) into the Todos project folder. cd "$TODOSPATH"
We should now have a project folder named 'meteor-todos', at the location specified within the TODOSPATH parameter. We've also changed directory (
cd) into the project folder, so let's add Electrify to this project!
# It's really this simple. electrify
That's right - a single word command, and our project is ready. Permissions may cause errors for you when trying to run
electrify as a command, in wihch case try
sudo electrify to override the permissions.
However, do attempt to resolve these permission issues - it is not good practice to unnecessarily
sudo (which I'd elaborate upon, but I could write a whole other topic on why that is!)