Book Image

NW.js Essentials

By : Alessandro Benoit, Roger Weng
Book Image

NW.js Essentials

By: Alessandro Benoit, Roger Weng

Overview of this book

Table of Contents (17 chapters)
NW.js Essentials
About the Author
About the Reviewers

Securing your source code

As I explained in the introduction, NW.js provides a way to protect part of your source code using nwjc (formerly nwsnapshot), which you should be able to find within the downloaded NW.js archive. This is still an experimental feature, so you should take extra care when using it.

Your code must be compiled with nwjc during the packaging process; then it's processed at runtime when the application gets executed. This will have a remarkable operational cost, and it will slow down the performances of your code by around 30 percent (based on V8 Benchmark suite results, as reported on the Wiki of the project).

Moreover, the compiled code will not be cross-platform nor compatible between different versions of NW.js, so you'll have to recompile your code at every update of NW.js for each operating system. Another limitation of nwjc is that there is a limit on the size of the source code to be compiled, which is around 250 KB.

Once we've established all the limitations of...