Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@version 0.2.0
@date 2015-05-29
@stability 1 - Experimental
A small pure-JavaScript web framework for building fast single-page applications.
The main idea is to use a declarative programming as much as possible.
See a working example with a source code in 60 lines.
Haml-inspired template engine that uses CSS selectors syntax for describing elements and attributes.
ul
li Item A
li Item B
becomes
<ul>
<li>Item A</li>
<li>Item B</li>
</ul>
Type selector, attribute selectors, ID selectors, and pseudo-classes are supported.
a#123.link.bold[href="#A"][title=go] link
button:disabled
becomes
<a id="123" class="link bold" href="#A" title="go">link</a>
<button disabled="disabled"></button>
Child combinators can be used and you can leave off the tag to get a div.
.my-class
a>i text
becomes
<div class="my-class">
<a><i>text</i></a>
</div>
ul
@template row
li.my-row
a > b Row
row
row
becomes
<ul>
<li class="my-row"><a><b>Row</b></a></li>
<li class="my-row"><a><b>Row</b></a></li>
</ul>
Organize views into a hierarchy with built-in router.
View(name, element, parent, contentSelector)
String
- A name for a view that is also a route to the view.
Accepts Level 1 URI Templates RFC 6570String
or Function
or DOM Node
-
View representation as DOM tree.
String and Function will be transformed to DOM Node on first call.String
- Parent view name.String, optional
- A selector to where a child Node will be attached.// Optional path for views, default = ""
View.base = "/js/views/"
// Define starting point in DOM
View("body", document.body)
// Create first simple view
View("home", ".home", "body")
// Create another view
View("work", ".work", "body")
// Start
View.main = "home"
history.start(View.route)
// call manualy
View("home").show()
Copyright (c) 2013-2015 Lauri Rooden <lauri@rooden.ee>
The MIT License
FAQs
Full-stack web framework in a tiny package
The npm package litejs receives a total of 91 weekly downloads. As such, litejs popularity was classified as not popular.
We found that litejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.