SQLITE/NODEJS WORKBENCH
SQLITE/NODEJS WORKBENCH is a VS Code workbench for writing Node.js + Express apps on SQLite.
Installation
From VSIX (Recommended)
- Open VS Code -> Extensions sidebar (
Ctrl+Shift+X)
- Click
... (More Actions) -> Install from VSIX...
- Select
nodejs-express-workbench-4.1.1.vsix
- Reload VS Code if prompted
From VS Code Marketplace
Search for "SQLITE/NODEJS WORKBENCH" in the Extensions panel and click Install.
Quick Start
# 1. Create your server file
# Type 'njs-server' in server.js -> press Tab
#
# 2. Add package.json
# Type 'njs-pkg' in package.json -> press Tab -> npm install
#
# 3. Start your server
node server.js
# Your REST API is live at http://localhost:3000
Snippets Reference
Setup & Server
| Prefix |
Description |
njs-server njs-sv |
Full Express + Better-SQLite3 server with DB, CRUD, graceful shutdown |
njs-express njs-ex |
Minimal Express server skeleton |
njs-db njs-dbc |
SQLite connection boilerplate |
njs-setup njs-st |
Express + static files + DB setup |
njs-pkg njs-pk |
package.json with all deps (express, better-sqlite3, cors, bcrypt, jwt, dotenv, nodemailer) |
CRUD Routes
| Prefix |
Description |
njs-get njs-g |
GET route with SELECT query |
njs-post njs-p |
POST route with INSERT |
njs-put njs-u |
PUT route with UPDATE |
njs-del njs-d |
DELETE route (or deactivate pattern) |
njs-router njs-rt |
Express Router with all CRUD boilerplate |
Authentication
| Prefix |
Description |
njs-users-table njs-ut |
Users table schema (email, password_hash, role, reset token) |
njs-jwt njs-jt |
JWT sign + verify helpers |
njs-auth njs-aw |
JWT verify middleware with optional role check |
njs-reg njs-rg |
Register route with bcrypt hashing |
njs-log |
Login route (verify credentials + return JWT) |
njs-forgot njs-fp |
Forgot password route with email reset |
njs-hash njs-hs |
bcrypt hash + compare utility functions |
Security
| Prefix |
Description |
njs-cors njs-cor |
CORS configuration |
njs-helmet njs-hm |
Helmet security headers |
njs-rate njs-rl |
Rate limiter with express-rate-limit |
njs-err njs-er |
Centralized error handler middleware |
Utilities
| Prefix |
Description |
njs-mw |
Custom middleware template |
njs-async njs-as |
Async error wrapper for Express routes |
njs-env njs-envcfg |
dotenv configuration |
njs-val njs-vl |
express-validator input validation |
njs-read njs-rd |
fs.readFile helper |
njs-write njs-wr |
fs.writeFile helper |
njs-path njs-ph |
path.join utility |
njs-page njs-pg |
SQL pagination (LIMIT/OFFSET) |
njs-res njs-rsp |
Standardized response wrapper |
njs-tx njs-trn |
SQLite transaction wrapper |
Frontend / Client
| Prefix |
Description |
njs-fetch njs-fc |
Fetch API wrapper with error handling |
njs-api njs-apc |
API Client class with CRUD methods |
njs-list-js njs-ls |
Fetch + render dynamic HTML list |
njs-form-js njs-fj |
Form submission handler |
njs-page-js njs-pj |
Full page JS (load, add, update, delete) |
njs-add-js njs-aj |
Standalone add function |
njs-update-js njs-uj |
Standalone update function |
njs-delete-js njs-dj |
Standalone delete function |
Other
| Prefix |
Description |
njs-socket njs-sk |
Socket.io server setup |
njs-upload njs-up |
Multer file upload configuration |
njs-mail njs-em |
Nodemailer email sender |
njs-logger |
Morgan HTTP request logger |
njs-cookie njs-ck |
Cookie-parser middleware |
njs-lg is a short prefix of two snippets (login route and Morgan logger). Type njs-log or njs-logger to get exactly one.
Schema Commands
| Command |
Description |
njs: Register Table |
Register a table schema |
njs: Remove Table |
Remove a registered table |
njs: Modify Table Fields |
Update fields of a registered table |
njs: Register this table |
Register from a CREATE TABLE SQL statement |
njs: Schema Status |
View all registered schemas |
njs: Add Foreign Key |
Define foreign key relationships |
njs: Remove Foreign Key |
Remove foreign key relationships |
njs: Schema Visualizer |
Open the schema panel |
njs: Generate All Tables |
Write code for all registered tables |
njs: Generate Project Files |
Write server.js, package.json, .env and HTML pages from the schema |
njs: Parse MySQL Schema |
Convert a MySQL CREATE TABLE dump to SQLite and register it |
njs: Setup TailwindCSS |
Add Tailwind v4 (optionally with daisyUI) to the current project and link output.css in public pages |
njs: Add daisyUI |
Add daisyUI to a project that already has Tailwind |
daisyUI
njs: Setup TailwindCSS asks whether you want Tailwind only or Tailwind + daisyUI. The daisyUI choice installs daisyui@latest, writes src/input.css with @import "tailwindcss"; and @plugin "daisyui";, and links /output.css in every page under public/. Both choices add the link, so nothing is left to do by hand. Pages that still load Tailwind from a CDN <script> are listed in a message; remove those tags.
For a project that already has Tailwind, run njs: Add daisyUI. Running either command twice changes nothing the second time. No config file is needed.
Classes worth knowing for the generated forms:
| Class |
Use |
btn btn-primary |
Save / Add button |
input |
Text, number and date fields |
select |
Dropdowns, including FK dropdowns |
table table-zebra |
List tables |
card |
A panel around a form or a list |
Release notes are in CHANGELOG.md.
Requirements
- VS Code 1.74.0 or higher
- Node.js 22.x or higher for the apps you build
Development checks
Run npm install and npm test for the regression suite. It parses server/client scripts written by the extension and executes SQL formula and FK dropdown regressions.
The HTTP and DOM integration test uses an app's installed dependencies plus jsdom. In that project, run npm install and npm install --no-save jsdom. Then run this from the extension repository in PowerShell:
$env:NJS_TEST_MODULES = 'C:\path\to\project\node_modules'
npm run test:integration
This starts an isolated server on a random local port and checks authentication, registration, CRUD, rule enforcement, transactional rollback, reports, escaping and modal/inline form round trips. Temporary test databases and servers are cleaned up afterward.
Build an installable package with npx @vscode/vsce package.
License
This project is licensed under the MIT License.
Made with love by weonlyliveonce