This extension contains code snippets for NW.js for Vs Code editor.
Installation
In order to install an extension you need to launch the Command Palette (Ctrl + Shift + P or Cmd + Shift + P) and type Extensions. There you have either the option to show the already installed snippets or install new ones. Search for NW.js snippets and install it.
.js Snippets
All js snippets are start with nw:
nw.: Official API
nw-: Some useful code snippets
nw.
Trigger
API
nwa
nw.App.*
nwc
nw.Clipboard.*
nwm
nw.Menu.*
nwp
process.*
nws
nw.Screen.*
nwshe
nw.Shell.*
nwsho
nw.Shortcut.*
nwt
nw.Tray.*
nww
nw.webview.*
nwwi
nw.Window.*
nw-
Prefix
Snippet Description
nw-menubar
Create a menubar
nw-contextmenu
Create a contextmenu
nw-tray
Create a tray
nw-globalHotKey
Register global hot key
nw-liveReload
Live reload current window
nw-liveReloadApp
Live reload app
nw-F5Reload
Press F5 to reload current window
nw-openBrowser
Open default browser
nw-openFile
Open file
nw-openFileManager
Open file manager
nw-openWindow
Open new window
nw-relaunchApp
Relaunch app
nw-getCurrentScreen
Get current screen
nw-hideWindowInsteadOfClose
Hide window instead of close
nw-draggable
Drag window by element
nw-showBackgroundDevtools
Show Background DevTools.
nw-drop-files
Get the dropped files.
nw-getScript
Get script
nw-ini
Read and write .ini files.
nw-json
Read and write .json files.
Node.js
Prefix
Snippet Description
nw-fs-read-dir
Reads the contents of a directory.
nw-fs-read-dir-sync
(sync) Reads the contents of a directory.
nw-fs-read-file
Reads a file.
nw-fs-read-file-sync
(sync) Reads a file.
nw-fs-write-file
Writes data to a file.
nw-fs-write-file-sync
(sync) Writes data to a file.
nw-fs-copy
Copies the entire directory structure from src to dest.
nw-fs-copy-sync
(sync) Copies the entire directory structure from src to dest.