Comparing version 0.1.3 to 0.2.1
{ | ||
"name": "odesza", | ||
"version": "0.1.3", | ||
"version": "0.2.1", | ||
"description": "Write clean, expressive templates with just HTML and inline JavaScript", | ||
@@ -10,3 +10,3 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "https://github.com/littlstar/odesza" | ||
"url": "https://github.com/wellsjo/odesza" | ||
}, | ||
@@ -16,5 +16,11 @@ "scripts": { | ||
}, | ||
"bin": { | ||
"odesza": "./cli.js" | ||
}, | ||
"devDependencies": { | ||
"tape": "^4.2.2" | ||
}, | ||
"dependencies": { | ||
"commander": "^2.9.0" | ||
} | ||
} |
@@ -5,9 +5,7 @@ # Odesza | ||
- multiple inheritance | ||
- variables | ||
- fully expressive inline JavaScript | ||
- multiple inheritance (extends, includes, blocks) | ||
- full access to inline ES6 JavaScript | ||
- support for Express | ||
- no magic, 0 dependencies, and just 150 lines of code | ||
## Variables & Statements | ||
## Variables & Expressions | ||
Variables are passed in when Odesza templates are rendered. Scope is maintained through includes and extends. You can also treat `${}` as a function statement. | ||
@@ -25,18 +23,18 @@ | ||
hello.ode | ||
``` | ||
```javascript | ||
<title>${title}</title> | ||
<p> | ||
Welcome, ${names.join(',')}! | ||
Welcome, ${names.map(n => `<i>${n}</i>`).join(', ')}! | ||
</p> | ||
``` | ||
output | ||
``` | ||
```html | ||
<title>hello world</title> | ||
<p> | ||
Welcome, foo, bar | ||
Welcome, <i>foo</i>, <i>bar</i> | ||
</p> | ||
``` | ||
## 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. | ||
## Inline JavaScript | ||
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. If you need more flexibility with inline js, you can create a self-executing function expression with code inside it like this: `${(() => { ... }())`. | ||
@@ -194,2 +192,8 @@ code | ||
## Command Line | ||
You can compile odesza templates from the command line to `stdout` or an output file. | ||
``` | ||
odesza <file> [-o <output>] | ||
``` | ||
## Install | ||
@@ -196,0 +200,0 @@ ``` |
'use strict'; | ||
const assert = require('assert'); | ||
const odesza = require('../'); | ||
const test = require('tape'); | ||
const path = require('path'); | ||
const diff = require('diff'); | ||
const fs = require('fs'); | ||
@@ -9,0 +7,0 @@ const fixture = file => path.join(__dirname, 'fixtures', file); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15671
27
243
203
1
4
+ Addedcommander@^2.9.0
+ Addedcommander@2.20.3(transitive)