@trebor/buildhtml 1.0.1 → 1.0.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.
- package/LICENSE +16 -10
- package/README.md +18 -19
- package/package.json +4 -5
package/LICENSE
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2026 0trebor0
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @trebor/buildhtml
|
|
2
2
|
|
|
3
|
-
**High-performance, server-side rendering (SSR) library for Node.js.**
|
|
4
|
-
*"Build HTML at lightning speed with reactive state management."*
|
|
3
|
+
**High-performance, server-side rendering (SSR) library for Node.js.** *"Build HTML at lightning speed with reactive state management."*
|
|
5
4
|
|
|
6
5
|
---
|
|
7
6
|
|
|
@@ -9,20 +8,20 @@
|
|
|
9
8
|
|
|
10
9
|
BuildHTML is a lightweight SSR library for Node.js featuring object pooling, reactive state management, and CSS-in-JS capabilities. Build HTML on the server with minimal memory usage and blazing-fast performance.
|
|
11
10
|
|
|
12
|
-
- **Zero dependencies** – Only Node.js required
|
|
13
|
-
- **High Performance** – Object pooling and LRU caching (1-5ms render time)
|
|
14
|
-
- **Reactive State** – Built-in state management with automatic UI updates
|
|
15
|
-
- **CSS-in-JS** – Scoped and global styling with automatic CSS generation
|
|
16
|
-
- **Security** – XSS protection, CSS sanitization, and CSP nonce support
|
|
17
|
-
- **Production Ready** – HTML minification, compression, and metrics
|
|
18
|
-
- **JSON Export** – Save/restore pages with optional obfuscation
|
|
11
|
+
- **Zero dependencies** – Only Node.js required.
|
|
12
|
+
- **High Performance** – Object pooling and LRU caching (1-5ms render time).
|
|
13
|
+
- **Reactive State** – Built-in state management with automatic UI updates.
|
|
14
|
+
- **CSS-in-JS** – Scoped and global styling with automatic CSS generation.
|
|
15
|
+
- **Security** – XSS protection, CSS sanitization, and CSP nonce support.
|
|
16
|
+
- **Production Ready** – HTML minification, compression, and metrics.
|
|
17
|
+
- **JSON Export** – Save/restore pages with optional obfuscation.
|
|
19
18
|
|
|
20
19
|
---
|
|
21
20
|
|
|
22
21
|
## Installation
|
|
23
22
|
|
|
24
23
|
```bash
|
|
25
|
-
npm install buildhtml
|
|
24
|
+
npm install @trebor/buildhtml
|
|
26
25
|
```
|
|
27
26
|
|
|
28
27
|
---
|
|
@@ -30,7 +29,7 @@ npm install buildhtml
|
|
|
30
29
|
## Quick Start
|
|
31
30
|
|
|
32
31
|
```javascript
|
|
33
|
-
const { Document } = require('buildhtml');
|
|
32
|
+
const { Document } = require('@trebor/buildhtml');
|
|
34
33
|
|
|
35
34
|
// Create a document
|
|
36
35
|
const doc = new Document();
|
|
@@ -257,7 +256,7 @@ const {
|
|
|
257
256
|
resetPools, // Reset object pools
|
|
258
257
|
healthCheck, // Health check data
|
|
259
258
|
metrics // Performance metrics
|
|
260
|
-
} = require('buildhtml');
|
|
259
|
+
} = require('@trebor/buildhtml');
|
|
261
260
|
```
|
|
262
261
|
|
|
263
262
|
---
|
|
@@ -268,7 +267,7 @@ const {
|
|
|
268
267
|
|
|
269
268
|
```javascript
|
|
270
269
|
const express = require('express');
|
|
271
|
-
const { Document } = require('buildhtml');
|
|
270
|
+
const { Document } = require('@trebor/buildhtml');
|
|
272
271
|
|
|
273
272
|
const app = express();
|
|
274
273
|
|
|
@@ -400,7 +399,7 @@ app.get('/spa', (req, res) => {
|
|
|
400
399
|
## Configuration
|
|
401
400
|
|
|
402
401
|
```javascript
|
|
403
|
-
const { CONFIG } = require('buildhtml');
|
|
402
|
+
const { CONFIG } = require('@trebor/buildhtml');
|
|
404
403
|
|
|
405
404
|
CONFIG.mode = 'prod'; // 'prod' or 'dev'
|
|
406
405
|
CONFIG.poolSize = 150; // Max pooled elements
|
|
@@ -436,14 +435,14 @@ clearCache('user-'); // Clear all keys containing 'user-'
|
|
|
436
435
|
### enableCompression()
|
|
437
436
|
|
|
438
437
|
```javascript
|
|
439
|
-
const { enableCompression } = require('buildhtml');
|
|
438
|
+
const { enableCompression } = require('@trebor/buildhtml');
|
|
440
439
|
app.use(enableCompression());
|
|
441
440
|
```
|
|
442
441
|
|
|
443
442
|
### warmupCache(routes)
|
|
444
443
|
|
|
445
444
|
```javascript
|
|
446
|
-
const { warmupCache } = require('buildhtml');
|
|
445
|
+
const { warmupCache } = require('@trebor/buildhtml');
|
|
447
446
|
|
|
448
447
|
await warmupCache([
|
|
449
448
|
{ key: 'home', builder: () => buildHomePage() },
|
|
@@ -546,7 +545,7 @@ doc.oncreate(() => {
|
|
|
546
545
|
```javascript
|
|
547
546
|
process.env.ENABLE_METRICS = 'true';
|
|
548
547
|
|
|
549
|
-
const { metrics } = require('buildhtml');
|
|
548
|
+
const { metrics } = require('@trebor/buildhtml');
|
|
550
549
|
|
|
551
550
|
// After some requests...
|
|
552
551
|
console.log(metrics.getStats());
|
|
@@ -663,7 +662,7 @@ const html = doc.render();
|
|
|
663
662
|
|
|
664
663
|
```javascript
|
|
665
664
|
const express = require('express');
|
|
666
|
-
const { Document, createCachedRenderer } = require('buildhtml');
|
|
665
|
+
const { Document, createCachedRenderer } = require('@trebor/buildhtml');
|
|
667
666
|
|
|
668
667
|
const app = express();
|
|
669
668
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trebor/buildhtml",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Zero-dependency, ultra-fast HTML builder for server-side rendering (SSR).",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -21,11 +21,10 @@
|
|
|
21
21
|
"server-side-rendering",
|
|
22
22
|
"javascript",
|
|
23
23
|
"nodejs",
|
|
24
|
-
"html-builder"
|
|
25
|
-
"buildhtml"
|
|
24
|
+
"html-builder"
|
|
26
25
|
],
|
|
27
26
|
"author": "0trebor0 <webdevme@outlook.com>",
|
|
28
|
-
"license": "
|
|
27
|
+
"license": "MIT",
|
|
29
28
|
"publishConfig": {
|
|
30
29
|
"access": "public"
|
|
31
30
|
},
|
|
@@ -36,4 +35,4 @@
|
|
|
36
35
|
"url": "https://github.com/0trebor0/buildhtml/issues"
|
|
37
36
|
},
|
|
38
37
|
"homepage": "https://github.com/0trebor0/buildhtml#readme"
|
|
39
|
-
}
|
|
38
|
+
}
|