NATIVESCRIPT

NATIVESCIPT BASICS




NativeScript allows you to build a fast cross-platform application that has a native UI. NativeScript is a true cross-platform framework that generates native speed applications using the native components of the host platform, all using JavaScript. Although NativeScript allows you to build your application in JavaScript, you have full access to the host OS from your code, allowing you to easily tweak or use new platform features instantly at native code speeds.


Why Native script?

Now, before you get worried about having to know both iOS and Android to make your application, NativeScript has that covered. To simplify things, NativeScript already has a wide number of components, or modules, that wrap the most common things a developer will need, which are called the NativeScript common core modules. So, instead of having to write any Android or iOS specific code like I did above to see if a file exists, you can just write the following code:

var fs = require('file-system');
var exists = fs.File.exists(path);

The NativeScript filesystem module has each of the native platforms' API wrapped up so all you have to do is write to a common interface. But when you need to do something outside of the built-in modules and components, NativeScript is the only environment that allows you to easily have full access to everything the device offers right from JavaScript.