Socket
Socket
Sign inDemoInstall

odesza

Package Overview
Dependencies
0
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1 to 0.1.2

2

package.json
{
"name": "odesza",
"version": "0.1.1",
"version": "0.1.2",
"description": "Write clean, expressive templates with just HTML and inline JavaScript",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -11,8 +11,3 @@ # Odesza

#Install
```
npm install odesza --save
```
# Variables
## Variables
Variables are passed in when Odesza templates are rendered. Scope is maintained through includes and extends.

@@ -27,15 +22,7 @@ ```javascript

#Inline JS
## Inline JS
Odesza makes it easy to write inline JavaScript in your templates. Under the hood, templates are evaluated as ES6 template strings, which means you have access to `${}` expressions.
**code**
greetings.ode
```javascript
var vars = {
names: ['wells', 'joe', 'dom']
};
odesza.compile('greetings.ode', vars);
```
**greetings.ode**
```javascript
<h2>welcome ${names.join(', ')}!</h2>

@@ -59,3 +46,11 @@

```
**output**
code
```javascript
var vars = {
names: ['wells', 'joe', 'dom']
};
odesza.compile('greetings.ode', vars);
```
output
```html

@@ -67,8 +62,17 @@ <h2>welcome wells, joe, dom!</h2>

```
# Partials
**welcome.ode**
## Partials
Odesza makes it easy to nest templates within each other. You can include templates as many levels deep as you like.
greeting.ode
```javascript
hello!
```
welcome.ode
```javascript
include greeting
welcome, ${name}!
```
**question.ode**
question.ode
```javascript

@@ -79,3 +83,3 @@ include welcome

```
**code**
code
```javascript

@@ -88,4 +92,5 @@ var vars = {

```
**output**
output
```
hello!
welcome, foo!

@@ -96,6 +101,6 @@

# Inheritance
## Inheritance
Odesza gives you access to multiple inheritance through extending templates and block scopes.
**layout.ode**
layout.ode
```jade

@@ -114,5 +119,5 @@ <!doctype html>

```
**page.ode** (extends layout.ode)
page.ode (extends layout.ode)
```html
extend layout
extends layout

@@ -129,5 +134,5 @@ block js

```
**extended_page.ode** (extends page.ode, overwrites 'content' block)
extended_page.ode (extends page.ode, overwrites 'content' block)
```html
extend page
extends page

@@ -140,3 +145,3 @@ block content

```
**code**
code
```javascript

@@ -150,3 +155,3 @@ var vars = {

```
**output**
output
```html

@@ -167,4 +172,5 @@ <!doctype html>

```
#Express Support
**index.js**
## Express Support
index.js
```javascript

@@ -174,3 +180,3 @@ app.set('view engine', 'ode');

```
**controller**
controller
```javascript

@@ -181,3 +187,9 @@ res.render('template', {

```
#License
## Install
```
npm install odesza --save
```
## License
MIT
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc