kaelum 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +52 -48
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,8 +1,15 @@
1
1
  # Kaelum
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/kaelum)](https://www.npmjs.com/package/kaelum)
4
+ [![Build Status](https://github.com/MatheusCampagnolo/kaelum/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/MatheusCampagnolo/kaelum/actions)
5
+ [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
6
+ [![Docs](https://img.shields.io/badge/docs-online-blue)](https://matheuscampagnolo.github.io/kaelum/)
7
+
3
8
  **Kaelum.JS** — Minimalist Node.js framework to simplify creation of web pages and REST APIs.
4
9
  Designed for students and developers who want a fast, opinionated project scaffold and a small, friendly API that encapsulates common Express.js boilerplate.
5
10
 
11
+ 👉 [**Read the full documentation here**](https://matheuscampagnolo.github.io/kaelum/)
12
+
6
13
  ---
7
14
 
8
15
  ## 🚀 Quick start
@@ -11,7 +18,7 @@ Create a new project (interactive):
11
18
 
12
19
  ```bash
13
20
  npx kaelum create
14
- ````
21
+ ```
15
22
 
16
23
  Or create non-interactively (project name + template):
17
24
 
@@ -35,13 +42,14 @@ npm start
35
42
 
36
43
  ## 📦 What Kaelum provides
37
44
 
38
- * CLI that scaffolds a ready-to-run project (Web or API template) using an opinionated **MVC** structure.
39
- * Thin abstraction layer over **Express.js** that:
45
+ - CLI that scaffolds a ready-to-run project (Web or API template) using an opinionated **MVC** structure.
46
+ - Thin abstraction layer over **Express.js** that:
40
47
 
41
- * automates JSON / URL-encoded parsing by default,
42
- * automatically configures common security middlewares via `setConfig` (CORS, Helmet),
43
- * exposes a small, easy-to-learn API for routes, middleware and configuration.
44
- * Small set of helpers for common tasks: `start`, `addRoute`, `apiRoute`, `setConfig`, `static`, `redirect`, `healthCheck`, `useErrorHandler`, and more.
48
+ - automates JSON / URL-encoded parsing by default,
49
+ - automatically configures common security middlewares via `setConfig` (CORS, Helmet),
50
+ - exposes a small, easy-to-learn API for routes, middleware and configuration.
51
+
52
+ - Small set of helpers for common tasks: `start`, `addRoute`, `apiRoute`, `setConfig`, `static`, `redirect`, `healthCheck`, `useErrorHandler`, and more.
45
53
 
46
54
  Kaelum aims to reduce the initial setup burden while keeping flexibility for advanced users.
47
55
 
@@ -49,7 +57,7 @@ Kaelum aims to reduce the initial setup burden while keeping flexibility for adv
49
57
 
50
58
  ## 📁 Template structures
51
59
 
52
- ### Web template (created by `npx kaelum create <name>` with template `web`)
60
+ ### Web template (`--template web`)
53
61
 
54
62
  ```
55
63
  my-web-app/
@@ -81,12 +89,12 @@ my-api-app/
81
89
 
82
90
  ---
83
91
 
84
- ## 🧩 Core API (examples — CommonJS)
92
+ ## 🧩 Core API
85
93
 
86
94
  > Kaelum exposes a factory — use `require('kaelum')` and call it to get an app instance:
87
95
 
88
96
  ```js
89
- const kaelum = require('kaelum');
97
+ const kaelum = require("kaelum");
90
98
  const app = kaelum();
91
99
  ```
92
100
 
@@ -96,17 +104,17 @@ Enable/disable common features:
96
104
 
97
105
  ```js
98
106
  app.setConfig({
99
- cors: true, // apply CORS (requires cors package in dependencies)
100
- helmet: true, // apply Helmet
101
- static: "public", // serve static files from "public"
102
- bodyParser: true, // default: enabled (JSON + urlencoded)
103
- logs: false, // enable request logging via morgan (if installed)
104
- port: 3000 // prefered port (used when calling app.start() without port)
107
+ cors: true, // apply CORS (requires cors package in dependencies)
108
+ helmet: true, // apply Helmet
109
+ static: "public", // serve static files from "public"
110
+ bodyParser: true, // default: enabled (JSON + urlencoded)
111
+ logs: false, // enable request logging via morgan (if installed)
112
+ port: 3000, // prefered port (used when calling app.start() without port)
105
113
  });
106
114
  ```
107
115
 
108
- * `setConfig` persists settings to the Kaelum config and will install/remove Kaelum-managed middlewares.
109
- * Kaelum enables JSON/urlencoded parsing by default so beginners won't forget to parse request bodies.
116
+ - `setConfig` persists settings to the Kaelum config and will install/remove Kaelum-managed middlewares.
117
+ - Kaelum enables JSON/urlencoded parsing by default so beginners won't forget to parse request bodies.
110
118
 
111
119
  ---
112
120
 
@@ -115,7 +123,7 @@ app.setConfig({
115
123
  Starts the HTTP server. If `port` is omitted, Kaelum reads `port` from `setConfig` or falls back to `3000`.
116
124
 
117
125
  ```js
118
- app.start(3000, () => console.log('Running'));
126
+ app.start(3000, () => console.log("Running"));
119
127
  ```
120
128
 
121
129
  ---
@@ -125,20 +133,20 @@ app.start(3000, () => console.log('Running'));
125
133
  Register routes easily:
126
134
 
127
135
  ```js
128
- app.addRoute('/home', {
129
- get: (req, res) => res.send('Welcome!'),
130
- post: (req, res) => res.send('Posted!')
136
+ app.addRoute("/home", {
137
+ get: (req, res) => res.send("Welcome!"),
138
+ post: (req, res) => res.send("Posted!"),
131
139
  });
132
140
 
133
141
  // apiRoute builds RESTy resources with nested subpaths:
134
- app.apiRoute('users', {
142
+ app.apiRoute("users", {
135
143
  get: listUsers,
136
144
  post: createUser,
137
- '/:id': {
145
+ "/:id": {
138
146
  get: getUserById,
139
147
  put: updateUser,
140
- delete: deleteUser
141
- }
148
+ delete: deleteUser,
149
+ },
142
150
  });
143
151
  ```
144
152
 
@@ -152,13 +160,13 @@ Flexible helper to register middleware(s):
152
160
 
153
161
  ```js
154
162
  // single middleware
155
- app.setMiddleware(require('helmet')());
163
+ app.setMiddleware(require("helmet")());
156
164
 
157
165
  // array of middlewares
158
166
  app.setMiddleware([mw1, mw2]);
159
167
 
160
168
  // mount middleware on a path
161
- app.setMiddleware('/admin', authMiddleware);
169
+ app.setMiddleware("/admin", authMiddleware);
162
170
  ```
163
171
 
164
172
  ---
@@ -168,7 +176,7 @@ app.setMiddleware('/admin', authMiddleware);
168
176
  Register a redirect route:
169
177
 
170
178
  ```js
171
- app.redirect('/old-url', '/new-url', 302);
179
+ app.redirect("/old-url", "/new-url", 302);
172
180
  ```
173
181
 
174
182
  ---
@@ -193,45 +201,42 @@ It will return standardized JSON for errors and log server-side errors (5xx) to
193
201
 
194
202
  ## 🔧 Local development & contributing
195
203
 
196
- To develop Kaelum locally and test the CLI:
197
-
198
204
  ```bash
199
- # clone
200
205
  git clone https://github.com/MatheusCampagnolo/kaelum.git
201
206
  cd kaelum
202
-
203
- # install & link locally
204
207
  npm install
205
208
  npm link
209
+ ```
210
+
211
+ Now you can test the CLI locally:
206
212
 
207
- # from any folder you can now run the CLI
213
+ ```bash
208
214
  npx kaelum create my-test --template web
209
- # or
210
- kaelum create my-test # if linked globally
211
215
  ```
212
216
 
213
217
  ---
214
218
 
215
-
216
219
  ## 📝 Why Kaelum?
217
220
 
218
- * Reduces repetitive boilerplate required to start Node/Express web projects.
219
- * Opinionated scaffolding (MVC) helps beginners adopt better structure.
220
- * Keeps a small API surface: easy to teach and document.
221
- * Extensible — `setConfig` and middleware helpers allow adding features without exposing Express internals.
221
+ - Reduces repetitive boilerplate required to start Node/Express web projects.
222
+ - Opinionated scaffolding (MVC) helps beginners adopt better structure.
223
+ - Keeps a small API surface: easy to teach and document.
224
+ - Extensible — `setConfig` and middleware helpers allow adding features without exposing Express internals.
222
225
 
223
226
  ---
224
227
 
225
228
  ## ✅ Current status
226
229
 
227
- > Kaelum is under active development. The CLI scaffolds web and API templates and the framework already includes the MVP helpers (`start`, `addRoute`, `apiRoute`, `setConfig`, `static`, `redirect`, `healthCheck`, `useErrorHandler`) and security toggles for `cors` and `helmet`.
230
+ > Kaelum is under active development.
231
+ > CLI scaffolds web and API templates, and the framework includes the MVP helpers (`start`, `addRoute`, `apiRoute`, `setConfig`, `static`, `redirect`, `healthCheck`, `useErrorHandler`) and security toggles for `cors` and `helmet`.
228
232
 
229
233
  ---
230
234
 
231
235
  ## 📚 Links
232
236
 
233
- * GitHub: `https://github.com/MatheusCampagnolo/kaelum`
234
- * npm: `https://www.npmjs.com/package/kaelum`
237
+ - [GitHub](https://github.com/MatheusCampagnolo/kaelum)
238
+ - [npm](https://www.npmjs.com/package/kaelum)
239
+ - [Documentation](https://matheuscampagnolo.github.io/kaelum/)
235
240
 
236
241
  ---
237
242
 
@@ -243,6 +248,5 @@ MIT — see [LICENSE](LICENSE).
243
248
 
244
249
  ## ✍️ Notes for maintainers
245
250
 
246
- * Templates include `package.json` configured as `commonjs` for now (uses `require`/`module.exports`).
247
- * Update template `package.json` dependencies to reference Kaelum version when releasing new npm versions.
248
- * We plan to add full JSDoc for the public API, unit tests (Jest + Supertest) and a docs site in future iterations.
251
+ - Templates use `commonjs` (`require` / `module.exports`).
252
+ - Update template dependencies to reference the correct Kaelum version when releasing new npm versions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaelum",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "A minimalist Node.js framework for building web pages and APIs with simplicity and speed.",
5
5
  "main": "index.js",
6
6
  "exports": {