UNPKG

3.28 kBMarkdownView Raw
1
2[![Build Status](https://travis-ci.org/nailsframework/nails.svg?branch=master)](https://travis-ci.org/nailsframework/nails)
3[![codecov](https://codecov.io/gh/nailsframework/nails/branch/master/graph/badge.svg)](https://codecov.io/gh/nailsframework/nails)
4
5
6
7# NailsFramework
8
9
10NailsFramework or short NailsJS is a new Javascript library.
11
12
13
14
15
16```I'm proud to announce that NailsJS enters the first stable state. You can safely use it. Please take a look at our branches to see, what version best suits you```
17
18
19
20To see whats possible, take a look into the index.html.
21
22
23
24# Why should i use NailsTS?
25
26
27
28Nails has been created out of one reason. Frustration.
29
30Mostly every JS Framework doesn't really scale down for small size project, instead they are horribly
31
32slow and space intensive. I don't want to use 300MB disk space for a hello world program just because
33those nasty dependencies.
34
35
36
37And exactly here comes nailsJS into place. It just nails it for small size projects but also perfectly scales up to enterprise solutions,
38
39although it's still in development. The Codebase is about 50KB and thats all. We try our best to keep the amount of dependencies down to a minimum. All dependencies we use are used to provide a solid runtime.
40
41
42
43Also there is no learning curve, because to create a wonderful, reactive WebApp you don't need to learn some complicated stuff.
44
45NailsTS is designed to be intuitive and easy.
46
47
48
49Thats it.
50
51
52
53# Features
54
55- Reusable Components
56
57- Dependency Injection
58
59- Reactive DOM. Change values in the console and see the magic happen.
60
61- String interpolation
62
63- Directives
64
65- Intelligent DOM Rendering, does not re-render whole DOM but only the parts, which
66have changed. This improves stability and performance.
67
68- Build from Ground up for Reactivity. No setState or other method calls required
69
70- Components run in their own context
71
72### Installation
73
74
75
76Please refer to the documentation in the wiki pages.
77
78
79
80### Branches
81
82
83
84
85
86|Branch|What to expect |
87|--|--|
88| master | The most stable version |
89| develop | Not really unstable, but bugs may occur. |
90| feature/ | For your own safety, and for the safety of your project, don't touch any of these. |
91
92
93
94
95
96
97
98### Development
99
100
101
102Want to contribute? Great!
103
104
105
106To create new directives simply add your function definition in ```directiveDefinitions.js``` and make sure
107
108that you added your definition in the ```directives``` array as well.
109
110
111
112Do not prefix your function and your array entry with an n, as this is done by the NailsJS Library.
113
114
115
116Below is a sample function body.
117
118```
119
120sample(element: HTMLElement, statement: String, state: State){
121
122
123
124}
125
126```
127
128```element```: The HTML element, which has added your directive.
129
130```statement```: The code in the directive. For example, if the directive declaration on the element is
131
132```n-if="formIsActive"``` then statement would be ```formIsActive```
133
134```state```: This is the current state, which represents NailsJS. To access user Data, you need to query
135
136```state.data```. Do not store Data outside of this object, as it's not actively monitored and a change in this data will not result in any DOM changes.
137
138### License
139
140
141
142MIT
143
144
145
146
147**Free Software, Hell Yeah!**
148
149
150
151* Author: Dominic Järmann
\No newline at end of file