However, equally important to the rise of Node.js has been the ecosystem that developed around it and its package manager, npm. Currently there are over 110,000 and counting free modules in the npm respository. This means that, in many cases, development teams can leverage pre-built libraries to help them develop their applications more rapidly.
In this article, we'll discuss the current state of bringing Node.js to mobile, the benefits that Node.js would bring on mobile and a new, potential solution to enabling Node.js development for mobile apps.
What About Mobile Apps?
What if you want to create a mobile version of your web application? Of course, Node.js will work just as well for building a responsive web application, but, in many case, you'll want an installable application iOS, Android and potentially Windows that can take advantage of the app marketplaces.
Today, you can achieve this by keeping all of the application's business logic on the server. In this case, the mobile application would simply be the user interface, written in the native language or using a hybrid solution like Cordova (aka PhoneGap). This user interface would get data and perform business logic via calls to a server side API. If mobile app requires portions of the business logic, it'd have to be rewritten in objective-C for iOS and Java for Android. While Cordova offers a solution for some code reuse, it cannot leverage Node or its ecosystem directly.
What Kept Node from Running on Mobile
Obviously, any mobile strategy that ignores iOS is doomed to fail.
Why Do I Need Node on Mobile?
Some mobile developers may wonder why they would need Node in developing mobile apps. They might say they have everything they need in platforms like Titanium or PhoneGap. Here are a few reasons:
- Use the same platform to develop your Server and Mobile apps. Many times your mobile app will have a corresponding browser based application for desktop access. Having one platform and one codebase for both the browser and mobile applications can make the development process far more efficient.
The JXCore Project
Recently, a project named JXCore announced that it will now be open source under the liberal MIT license. One of the key features in the recent release was the ability to run Node.js applications on mobile, both Android and iOS, while leveraging the full Node.js ecosystem on npm.
While the project's creator, Nubisa, says that the current version is still "in development," it is currently available on GitHub.
These possibilities definitely make JXCore a project worth watching to see how it develops.