neobiz 1.2.0 → 1.2.2
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 +21 -0
- package/package.json +1 -1
- package/readme.md +18 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Abista_VD
|
|
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/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -8,6 +8,8 @@ Neobiz.js is pure JS lang, transpile Object to HTML as string
|
|
|
8
8
|
|
|
9
9
|
`read /example dir to understanding`
|
|
10
10
|
|
|
11
|
+
[this link to usage in express.js](https://www.npmjs.com/package/neobiz-express?activeTab=dependencies)
|
|
12
|
+
|
|
11
13
|
**Features**
|
|
12
14
|
|
|
13
15
|
| function | params | return-type | description |
|
|
@@ -17,6 +19,16 @@ Neobiz.js is pure JS lang, transpile Object to HTML as string
|
|
|
17
19
|
| range | length:int, start:int | Array | shortcut for looping in a range |
|
|
18
20
|
| partial | source:string | AsyncFn | including other file |
|
|
19
21
|
|
|
22
|
+
#### Why use this?
|
|
23
|
+
|
|
24
|
+
- One lang for all, backend-view-browser script all just use js!
|
|
25
|
+
- **directly** interact data or Model with a view
|
|
26
|
+
- Could generate static html file
|
|
27
|
+
- Full control of serving the view. Such as encrypting the data before serve, or just like conditional and loop case
|
|
28
|
+
- Almost no need to learn anything. Just need to learn how to render
|
|
29
|
+
- Limitless potential, because it's just js. Almost all library should be compatible
|
|
30
|
+
- Just like JSON replace XML
|
|
31
|
+
|
|
20
32
|
## Basic syntax
|
|
21
33
|
|
|
22
34
|
It's just Object in js!
|
|
@@ -38,7 +50,7 @@ properties dom
|
|
|
38
50
|
// text property is same as innerHTML
|
|
39
51
|
h1: {
|
|
40
52
|
class:"heading",
|
|
41
|
-
text: "Hello World!"
|
|
53
|
+
text: "Hello World!",
|
|
42
54
|
style:"color: #DC1E1E"
|
|
43
55
|
}
|
|
44
56
|
}
|
|
@@ -96,11 +108,14 @@ What if there is somethings in the middle of list?
|
|
|
96
108
|
|
|
97
109
|
Can't use array? just use this:
|
|
98
110
|
|
|
111
|
+
> use string as key could distinc element just with a space
|
|
112
|
+
> no need to worry, it will render without space
|
|
113
|
+
|
|
99
114
|
```js
|
|
100
115
|
{
|
|
101
116
|
li:{text:"orange"},
|
|
102
117
|
p:{span:{text:"This is in the middle"}}
|
|
103
|
-
li:{text:"banana"},
|
|
118
|
+
"li ":{text:"banana"},
|
|
104
119
|
}
|
|
105
120
|
```
|
|
106
121
|
|
|
@@ -229,7 +244,7 @@ while
|
|
|
229
244
|
|
|
230
245
|
### partial
|
|
231
246
|
|
|
232
|
-
make sure to export as function
|
|
247
|
+
make sure to default export as a function
|
|
233
248
|
|
|
234
249
|
```js
|
|
235
250
|
import { render, partial } from "../index.js";
|