@jaredwray/fumanchu 1.1.1 → 1.1.3
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/LICENSE +1 -1
- package/README.md +7 -6
- package/lib/utils/index.js +3 -0
- package/package.json +8 -4
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
|
+
|
|
2
3
|
|
|
3
4
|
# fumanchu
|
|
4
5
|
Handlebars + Helpers Together
|
|
@@ -9,7 +10,7 @@ Handlebars + Helpers Together
|
|
|
9
10
|
[](https://github.com/jaredwray/fumanchu/blob/master/LICENSE)
|
|
10
11
|
[](https://npmjs.com/package/@jaredwray/fumanchu)
|
|
11
12
|
|
|
12
|
-
[Handlebars](https://github.com/handlebars-lang/handlebars.js) + [Handlebars-helpers](https://github.com/helpers/handlebars-helpers) (helpers are now maintained in this project) combined into a single package. Easily use in your nodejs
|
|
13
|
+
[Handlebars](https://github.com/handlebars-lang/handlebars.js) + [Handlebars-helpers](https://github.com/helpers/handlebars-helpers) (helpers are now maintained in this project) combined into a single package. Easily use in your nodejs as it is a drop in replacement when using handlebars directly.
|
|
13
14
|
|
|
14
15
|
## Table of Contents
|
|
15
16
|
* [Using in Nodejs](#using-in-nodejs)
|
|
@@ -33,7 +34,7 @@ var html = template({foo: 'bar'});
|
|
|
33
34
|
console.log(html);
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
If using it with es6 you can access
|
|
37
|
+
If using it with es6 you can access `handlebars` via destructuring:
|
|
37
38
|
|
|
38
39
|
```javascript
|
|
39
40
|
import handlebars from '@jaredwray/fumanchu';
|
|
@@ -49,14 +50,14 @@ It's just that easy! No need to add Handlebars to your project, it's already inc
|
|
|
49
50
|
If you only want to use handlebar helpers you can easily do that by doing the following:
|
|
50
51
|
|
|
51
52
|
```javascript
|
|
52
|
-
var helpers = require('@jaredwray/fumanchu').
|
|
53
|
+
var helpers = require('@jaredwray/fumanchu').handlebarHelpers;
|
|
53
54
|
var handlebars = require('handlebars');
|
|
54
55
|
helpers({ handlebars: handlebars });
|
|
55
56
|
var fn = handlebars.compile('{{add value 5}}');
|
|
56
57
|
console.log(fn);
|
|
57
58
|
```
|
|
58
59
|
|
|
59
|
-
If using it with es6 you can access
|
|
60
|
+
If using it with es6 you can access `helpers` via destructuring:
|
|
60
61
|
|
|
61
62
|
```javascript
|
|
62
63
|
import fumanchu from '@jaredwray/fumanchu';
|
|
@@ -3078,4 +3079,4 @@ Now that you've set up your workspace, you're ready to contribute changes to the
|
|
|
3078
3079
|
## License and Copyright
|
|
3079
3080
|
[MIT](LICENSE) and codebase after 2023 will be copyright of Jared Wray.
|
|
3080
3081
|
|
|
3081
|
-
This is a fork of [handlebars-helpers]() which is licensed under MIT. Initial copyright of handlebars-helpers: `2013-2015, 2017, Jon Schlinkert, Brian Woodward`. Thank you so much for your effort and building this! We have also continued to list all contributors in `package.json` to ensure that they are recognized.
|
|
3082
|
+
This is a fork of [handlebars-helpers]() which is licensed under MIT. Initial copyright of handlebars-helpers: `2013-2015, 2017, Jon Schlinkert, Brian Woodward`. Thank you so much for your effort and building this! We have also continued to list all contributors in `package.json` to ensure that they are recognized.
|
package/lib/utils/index.js
CHANGED
|
@@ -31,6 +31,9 @@ utils.contains = function(val, obj, start) {
|
|
|
31
31
|
utils.chop = function(str) {
|
|
32
32
|
if (!util.isString(str)) return '';
|
|
33
33
|
var re = /^[-_.\W\s]+|[-_.\W\s]+$/g;
|
|
34
|
+
if(str.length > 1000) {
|
|
35
|
+
throw new Error('utils.chop() regex is too long!');
|
|
36
|
+
}
|
|
34
37
|
return str.trim().replace(re, '');
|
|
35
38
|
};
|
|
36
39
|
|
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.3",
|
|
5
5
|
"homepage": "https://github.com/jaredwray/fumanchu",
|
|
6
6
|
"author": "Jared Wray (me@jaredwray.com)",
|
|
7
7
|
"keywords": [
|
|
@@ -103,7 +103,9 @@
|
|
|
103
103
|
"scripts": {
|
|
104
104
|
"test": "c8 mocha --reporter list",
|
|
105
105
|
"test:ci": "c8 --reporter=lcov mocha --reporter list",
|
|
106
|
-
"clean": "
|
|
106
|
+
"clean": "rimraf ./node_modules ./coverage yarn.lock package-lock.json",
|
|
107
|
+
"website:build": "rimraf ./site/readme.md && npx -y writr build -s ./site -o ./dist-site",
|
|
108
|
+
"website:serve": "rimraf ./site/readme.md && npx -y writr serve -s ./site -o ./dist-site"
|
|
107
109
|
},
|
|
108
110
|
"dependencies": {
|
|
109
111
|
"arr-flatten": "^1.1.0",
|
|
@@ -136,9 +138,11 @@
|
|
|
136
138
|
"year": "^0.2.1"
|
|
137
139
|
},
|
|
138
140
|
"devDependencies": {
|
|
139
|
-
"c8": "^
|
|
141
|
+
"c8": "^9.1.0",
|
|
140
142
|
"chai": "^4.3.10",
|
|
141
|
-
"
|
|
143
|
+
"fs-extra": "^11.2.0",
|
|
144
|
+
"mocha": "^10.3.0",
|
|
145
|
+
"rimraf": "^5.0.5",
|
|
142
146
|
"template-helpers": "^1.0.1",
|
|
143
147
|
"templates": "^1.2.9"
|
|
144
148
|
}
|