NKMjs is yet another JS library to build cross-plateform applications.
· · ·
It enables you to maintain a single source and package it as a Progressive Web App (PWA), browser extensions (Chromium-based browser & Firefox) & Electron app in one command line.
· · ·
First, install Node.js, then a package manager.
While Node.js comes bundled with npm it is strongly recommended to use Yarn, and required when targeting Electron.
Open a command prompt in the folder where you want to quickstart a project; then initialize Yarn :
npm install -g yarn // This installs Yarn on your machine.
yarn init // This will prompt Yarn wizard to initialize package.json
Next, install the two main packages of NKMjs :
yarn add @nkmjs/core
yarn add @nkmjs/core-dev --dev
@nkmjs/core contains the actual app framework modules, while @nkmjs/core-dev contains the build & automation tools.
Last but not least, bootstrap NKMjs and get coding !
yarn run nkmjs bootstrap
NKMjs is primarily oriented toward developing tools & self contained applications. Once compiled, the app itself is constructed on the fly inside the client (meaning no server-side rendering, no 'per-page' metadata etc).
The application framework itself is plain javascript. When packaged for Electron, it isn't transformed (bundled); however for extensions & PWA, the code is bundled using Browserify, transpiled using Babel for broader compatibility & finally minified using Terser plus an additional bit of custom transforms.
· · ·