NW.js Essentials
eBook - ePub

NW.js Essentials

Alessandro Benoit

Share book
  1. 192 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

NW.js Essentials

Alessandro Benoit

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is NW.js Essentials an online PDF/ePUB?
Yes, you can access NW.js Essentials by Alessandro Benoit in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in JavaScript. We have over one million books available in our catalogue for you to explore.

Information

NW.js Essentials


Table of Contents

NW.js Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Meet NW.js
NW.js under the hood
Features and drawbacks of NW.js
NW.js – usage scenarios
Popular NW.js applications
Downloading and installing NW.js
Installing NW.js on Mac OS X
Installing NW.js on Microsoft Windows
Installing NW.js on Linux
Development tools
Writing and running your first "Hello World" app
Running NW.js applications on Sublime Text 2
Running NW.js applications on Microsoft Windows
Running NW.js applications on Mac OS
Running NW.js applications on Linux
Summary
2. NW.js Native UI APIs
The App API – the core of your applications
Opening a file in your application natively
Accessing the application data folder path
Accessing the manifest file data
Best practices for closing applications
Registering system-wide hotkeys
Other app APIs
The Window API – working with windows on NW.js
Instantiating a new window object
Window – setting size and position of windows
Changing the window status
Fullscreen windows and the Kiosk mode
Frameless windows and drag regions
The taskbar icon – get the user's attention!
Closing windows
Other Window APIs
The Screen API – screen geometry functions
The Menu API – handling window and context menus
The contextual menu
The window menu
File dialogs – opening and saving files
Opening multiple files
Filtering by file type
Opening a directory
Saving files
Suggesting a default path
Opening files through file dragging
The Tray API – hide your application in plain sight
The Clipboard API – accessing the system clipboard
The Shell API – platform-dependent desktop functions
Summary
3. Leveraging the Power of Node.js
Routing and templating in NW.js
Node.js global and process objects
The window object
Using NW.js' main module
Handling paths in NW.js
NW.js context issues
Working with Node.js modules
Internal modules
Third-party modules written in JavaScript
Third-party modules with C/C++ add-ons
Summary
4. Data Persistence Solutions and Other Browser Web APIs
Data persistence solutions
Web storage
Web SQL Database
IndexedDB
XMLHttpRequest and BLOBs
Handling media files
Shedding some light on security issues
The Web Notifications API
Summary
5. Let's Put It All Together
Let's get started!
A matter of style
The HTML5 skeleton
Let's dive deep into the application logic
The application layer
Adding a new task
Loading all the tasks
Implementing export and sync features
The NativeUI layer
Implementing the Window menu
Implementing the Context menu
Restoring the window position
Implementing the Options window
Closing the application
Making the application open smoothly
Summary
6. Packaging Your Application for Distribution
The manifest file
The general logic behind the packaging procedure
Packaging NW.js applications for Mac OS X
Associating a file extension with your application
Packaging NW.js applications for Microsoft Windows
Registering a file type association on Microsoft Windows
Packaging NW.js applications for Linux
Adding icon and file type associations on Linux
Securing your source code
About NW.js application licensing
Summary
7. Automated Packaging Tools
Web2Executable
node-webkit-builder and grunt-node-webkit-builder
grunt-node-webkit-builder
generator-node-webkit
Summary
8. Let's Debug Your Application
Remote debugging
The DevTools API
Live reloading NW.js
Troubleshooting common issues
Summary
9. Taking Your Application to the Next Level
NW.js boilerplates
node-webkit-hipster-seed
angular-desktop-app
node-webkit-tomster-seed
node-webkit-boilerplate
nw-boilerplate
Development ideas
Resources and tutorials
Summary
Index

NW.js Essentials

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2015
Production reference: 1190515
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-086-3
www.packtpub.com

Credits

Author
Alessandro Benoit
Reviewers
Dan Bendell
Marco Fabbri
Julio Freitas
Commissioning Editor
Amarabha Banerjee
Acquisition Editor
Reshma Raman
Content Development Editor
Gaurav Sharma
Technical Editor
Humera Shaikh
Copy Editor
Sarang Chari
Project Coordinator
Harshal Ved
Proofreaders
Stephen Copestake
Safis Editing
Indexer
Mariammal Chettiyar
Graphics
Disha Haria
Abhinash Sahu
Production Coordinator
Alwin Roy
Cover Work
Alwin Roy

About the Author

Alessandro Benoit is a 31-year-old web developer from Italy. He currently works both with backend and frontend technologies, ranging from PHP development, mostly on WordPress and Laravel, to web design and building open source jQuery plugins. He's also an early adopter of NW.j...

Table of contents