janja 1.0.0 → 2.0.0
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/dist/index.cjs.js +1858 -1040
- package/dist/index.d.ts +242 -142
- package/dist/index.esm.js +1858 -1036
- package/dist/index.js +1858 -1040
- package/package.json +6 -26
- package/LICENSE +0 -21
- package/README.md +0 -39
package/package.json
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "janja",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
5
|
-
"packageManager": "yarn@4.9.2",
|
|
4
|
+
"version": "2.0.0",
|
|
6
5
|
"description": "A simple, fast, lightweight, and extensible template engine for Node.js and browsers.",
|
|
7
6
|
"license": "MIT",
|
|
8
|
-
"workspaces": [
|
|
9
|
-
"perf",
|
|
10
|
-
"repl",
|
|
11
|
-
"."
|
|
12
|
-
],
|
|
13
7
|
"exports": {
|
|
14
8
|
"types": "./dist/index.d.ts",
|
|
15
9
|
"import": "./dist/index.esm.js",
|
|
@@ -23,30 +17,16 @@
|
|
|
23
17
|
"dist"
|
|
24
18
|
],
|
|
25
19
|
"scripts": {
|
|
26
|
-
"build": "rm -rf dist && rollup -c"
|
|
27
|
-
"dev": "vitest watch",
|
|
28
|
-
"test": "vitest",
|
|
29
|
-
"repl": "yarn workspace repl run start",
|
|
30
|
-
"perf": "yarn workspace perf run start",
|
|
31
|
-
"lint": "oxlint && eslint . --ext .ts",
|
|
32
|
-
"prepare": "husky"
|
|
20
|
+
"build": "rm -rf dist && rollup -c"
|
|
33
21
|
},
|
|
34
22
|
"devDependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"@rollup/plugin-commonjs": "^28.0.9",
|
|
23
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
37
24
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
38
25
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
39
|
-
"@types/node": "^24.
|
|
40
|
-
"
|
|
41
|
-
"@vitest/ui": "4.0.3",
|
|
42
|
-
"eslint": "^9.38.0",
|
|
43
|
-
"husky": "^9.1.7",
|
|
44
|
-
"oxlint": "^1.24.0",
|
|
45
|
-
"rollup": "^4.52.5",
|
|
26
|
+
"@types/node": "^24.10.1",
|
|
27
|
+
"rollup": "^4.53.2",
|
|
46
28
|
"rollup-plugin-dts": "^6.2.3",
|
|
47
29
|
"tslib": "^2.8.1",
|
|
48
|
-
"typescript": "^5.9.3"
|
|
49
|
-
"vite": "^7.1.12",
|
|
50
|
-
"vitest": "^4.0.3"
|
|
30
|
+
"typescript": "^5.9.3"
|
|
51
31
|
}
|
|
52
32
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 李文富
|
|
4
|
-
|
|
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:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
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
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# Janja
|
|
2
|
-
|
|
3
|
-
<p align="center">A simple, fast, lightweight, and extensible template engine for Node.js and browsers.</p>
|
|
4
|
-
|
|
5
|
-
<p align="center">
|
|
6
|
-
<a href="https://github.com/vvenv/janja/actions/workflows/test.yml"><img src="https://github.com/vvenv/janja/actions/workflows/test.yml/badge.svg" alt="test"></a>
|
|
7
|
-
</p>
|
|
8
|
-
|
|
9
|
-
<p align="center">
|
|
10
|
-
<a href="./README-zh-CN.md">中文</a>
|
|
11
|
-
</p>
|
|
12
|
-
|
|
13
|
-
## Key Features
|
|
14
|
-
|
|
15
|
-
- 📝 **Intuitive Template Syntax**: Simple syntax for variables, conditionals, and loops.
|
|
16
|
-
- 🔗 **Custom global variables**: Supports definition of global variables.
|
|
17
|
-
- 🛠️ **Built-in Tags and Filters**: A collection of built-in tags and filters.
|
|
18
|
-
- 🎨 **Custom Tags and Filters**: Ability to define custom tags and filters.
|
|
19
|
-
- 🚀 **Pre-compilation**: Enhance rendering performance by precompiling.
|
|
20
|
-
- 🐛 **Error Handling and Debugging**: Provides detailed error reporting and debugging support.
|
|
21
|
-
- 🛡️ **Security**: Sandbox mode, and automatic escaping.
|
|
22
|
-
- 🛫 **Asynchronous Data Loading**: Supports fetching and displaying remote data asynchronously.
|
|
23
|
-
|
|
24
|
-
## Getting Started
|
|
25
|
-
|
|
26
|
-
```javascript
|
|
27
|
-
const engine = new Engine()
|
|
28
|
-
const html = await engine.render('Hello, {{= name }}!', { name: 'World' })
|
|
29
|
-
// or
|
|
30
|
-
// const html = await engine.renderFile('./template.html', { name: 'World' })
|
|
31
|
-
|
|
32
|
-
document.body.innerHTML = html
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
[Documentation](./documentation.md)
|
|
36
|
-
|
|
37
|
-
## License
|
|
38
|
-
|
|
39
|
-
`Janja` is released under the [MIT License](https://opensource.org/licenses/MIT). You are free to use, modify, and distribute it as long as you comply with the license terms.
|