@jaredwray/fumanchu 1.1.0 → 1.1.1
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/README.md +23 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -33,6 +33,15 @@ var html = template({foo: 'bar'});
|
|
|
33
33
|
console.log(html);
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
If using it with es6 you can access both `handlebars` via destructuring:
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
import handlebars from '@jaredwray/fumanchu';
|
|
40
|
+
const template = handlebars.compile('{{#if (eq foo "bar")}}<p>Foo is bar</p>{{/if}}');
|
|
41
|
+
const html = template({foo: 'bar'});
|
|
42
|
+
console.log(html);
|
|
43
|
+
```
|
|
44
|
+
|
|
36
45
|
It's just that easy! No need to add Handlebars to your project, it's already included.
|
|
37
46
|
|
|
38
47
|
## Using Handlebars Helpers
|
|
@@ -40,14 +49,26 @@ It's just that easy! No need to add Handlebars to your project, it's already inc
|
|
|
40
49
|
If you only want to use handlebar helpers you can easily do that by doing the following:
|
|
41
50
|
|
|
42
51
|
```javascript
|
|
43
|
-
var helpers = require('@jaredwray/fumanchu').
|
|
52
|
+
var helpers = require('@jaredwray/fumanchu').helpers;
|
|
44
53
|
var handlebars = require('handlebars');
|
|
45
54
|
helpers({ handlebars: handlebars });
|
|
46
55
|
var fn = handlebars.compile('{{add value 5}}');
|
|
47
56
|
console.log(fn);
|
|
48
57
|
```
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
If using it with es6 you can access both `helpers` via destructuring:
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
import fumanchu from '@jaredwray/fumanchu';
|
|
63
|
+
import handlebars from 'handlebars';
|
|
64
|
+
const {handlebarHelpers} = fumanchu;
|
|
65
|
+
handlebarHelpers({ handlebars: handlebars });
|
|
66
|
+
const template = handlebars.compile('{{#if (eq foo "bar")}}<p>Foo is bar</p>{{/if}}');
|
|
67
|
+
const html = template({foo: 'bar'});
|
|
68
|
+
console.log(html);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Notice that in this scenario you are accessing helpers via `helpers` from `fumanchu` instead of just using handlebars via fumanchu directly.
|
|
51
72
|
|
|
52
73
|
## Helpers
|
|
53
74
|
More than 180 Handlebars helpers in ~20 categories. Helpers can be used with Assemble, Generate, Verb, Ghost, gulp-handlebars, grunt-handlebars, consolidate, or any node.js/Handlebars project.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaredwray/fumanchu",
|
|
3
3
|
"description": "Handlebars + Helpers = Fumanchu",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"homepage": "https://github.com/jaredwray/fumanchu",
|
|
6
6
|
"author": "Jared Wray (me@jaredwray.com)",
|
|
7
7
|
"keywords": [
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
139
|
"c8": "^8.0.1",
|
|
140
|
-
"chai": "^4.3.
|
|
140
|
+
"chai": "^4.3.10",
|
|
141
141
|
"mocha": "^10.2.0",
|
|
142
142
|
"template-helpers": "^1.0.1",
|
|
143
143
|
"templates": "^1.2.9"
|