Skip to content

Commit f181e92

Browse files
committed
first commit
0 parents  commit f181e92

10 files changed

+406
-0
lines changed

.gitattributes

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Enforce Unix newlines
2+
*.* text eol=lf
3+
*.css text eol=lf
4+
*.html text eol=lf
5+
*.js text eol=lf
6+
*.json text eol=lf
7+
*.less text eol=lf
8+
*.md text eol=lf
9+
*.yml text eol=lf
10+
11+
*.jpg binary
12+
*.gif binary
13+
*.png binary
14+
*.jpeg binary

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.sublime-*
2+
_gh_pages
3+
bower_components
4+
node_modules
5+
npm-debug.log
6+
temp
7+
test/actual
8+
tmp
9+
TODO.md
10+
vendor

.jshintrc

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"asi": false,
3+
"boss": true,
4+
"curly": true,
5+
"eqeqeq": true,
6+
"eqnull": true,
7+
"esnext": true,
8+
"immed": true,
9+
"latedef": true,
10+
"laxcomma": false,
11+
"newcap": true,
12+
"noarg": true,
13+
"node": true,
14+
"sub": true,
15+
"undef": true,
16+
"unused": true,
17+
"mocha": true
18+
}

.verb.md

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# {%= name %} {%= badge("fury") %}
2+
3+
> {%= description %}
4+
5+
{%= include("install-npm", {save: true}) %}
6+
7+
**Examples**
8+
9+
```js
10+
{%%= year() %}
11+
//=> {%= year() %}
12+
{%%= year("YYYY") %}
13+
//=> {%= year("YYYY") %}
14+
{%%= year("YY") %}
15+
//=> {%= year("YY") %}
16+
```
17+
18+
## Run tests
19+
20+
```bash
21+
npm test
22+
```
23+
{% var nickname = strip(name, "helper-") %}
24+
## Register the helper
25+
26+
> This should work with any engine, here are a few examples
27+
28+
### [template]
29+
30+
Register the helper for use with any template engine
31+
32+
```js
33+
template.helper('{%= nickname %}', require('{%= name %}'));
34+
```
35+
36+
### [assemble]
37+
38+
To register the helper for use with [assemble] v0.6.x:
39+
40+
```js
41+
assemble.helper('{%= nickname %}', require('{%= name %}'));
42+
```
43+
44+
### [verb]
45+
46+
Register the helper for use with [verb]:
47+
48+
```js
49+
var verb = require('verb');
50+
verb.helper('{%= nickname %}', require('{%= name %}'));
51+
52+
verb.task('default', function() {
53+
verb.src('.verb*.md')
54+
.pipe(verb.dest('./'));
55+
});
56+
```
57+
58+
### [handlebars]
59+
60+
```js
61+
var handlebars = require('handlebars');
62+
handlebars.registerHelper('{%= nickname %}', require('{%= name %}'));
63+
```
64+
65+
### [Lo-Dash] or [underscore]
66+
67+
```js
68+
// as a mixin
69+
_.mixin({{%= nickname %}: require('{%= name %}')});
70+
_.template('<%= _.{%= nickname %}() %>', {});
71+
//=> {%= year() %}
72+
73+
// passed on the context
74+
_.template('<%= {%= nickname %}() %>', {{%= nickname %}: require('{%= name %}')});
75+
//=> {%= year() %}
76+
77+
// as an import
78+
var settings = {imports: {{%= nickname %}: require('{%= name %}')}};
79+
_.template('<%= {%= nickname %}() %>', {}, settings);
80+
//=> {%= year() %}
81+
```
82+
83+
## Contributing
84+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %})
85+
86+
To request or contribute a helper to the [github.com/helpers][helpers] org, please read [this contributing guide][guide] to get started.
87+
88+
## Author
89+
{%= include("author") %}
90+
91+
## License
92+
{%= copyright() %}
93+
{%= license() %}
94+
95+
***
96+
97+
{%= include("footer") %}
98+
99+
[assemble]: https://github.com/assemble/assemble
100+
[generator-verb]: https://github.com/assemble/generator-verb
101+
[handlebars-helpers]: https://github.com/assemble/handlebars-helpers/
102+
[handlebars]: https://github.com/wycats/handlebars.js/
103+
[helpers]: https://github.com/helpers
104+
[Lo-Dash]: https://lodash.com/
105+
[template]: https://github.com/jonschlinkert/template
106+
[underscore]: https://github.com/jashkenas/underscore
107+
[verb]: https://github.com/assemble/verb
108+
[guide]: https://github.com/helpers/requests

LICENSE-MIT

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Jon Schlinkert
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# helper-year [![NPM version](https://badge.fury.io/js/helper-year.svg)](http://badge.fury.io/js/helper-year)
2+
3+
> Template helper for adding the current year. Good for adding dates for licenses, copyrights, last modified date, comment dates, etc. Works with handlebars, lo-dash or any template engine that has support for helper functions.
4+
5+
## Install with [npm](npmjs.org)
6+
7+
```bash
8+
npm i helper-year --save
9+
```
10+
11+
**Examples**
12+
13+
```js
14+
{%= year() %}
15+
//=> 2014
16+
{%= year("YYYY") %}
17+
//=> 2014
18+
{%= year("YY") %}
19+
//=> 14
20+
```
21+
22+
## Run tests
23+
24+
```bash
25+
npm test
26+
```
27+
28+
## Register the helper
29+
30+
> This should work with any engine, here are a few examples
31+
32+
### [template]
33+
34+
Register the helper for use with any template engine
35+
36+
```js
37+
template.helper('year', require('helper-year'));
38+
```
39+
40+
### [assemble]
41+
42+
To register the helper for use with [assemble] v0.6.x:
43+
44+
```js
45+
assemble.helper('year', require('helper-year'));
46+
```
47+
48+
### [verb]
49+
50+
Register the helper for use with [verb]:
51+
52+
```js
53+
var verb = require('verb');
54+
verb.helper('year', require('helper-year'));
55+
56+
verb.task('default', function() {
57+
verb.src('.verb*.md')
58+
.pipe(verb.dest('./'));
59+
});
60+
```
61+
62+
### [handlebars]
63+
64+
```js
65+
var handlebars = require('handlebars');
66+
handlebars.registerHelper('year', require('helper-year'));
67+
```
68+
69+
### [Lo-Dash] or [underscore]
70+
71+
```js
72+
// as a mixin
73+
_.mixin({year: require('helper-year')});
74+
_.template('<%= _.year() %>', {});
75+
//=> 2014
76+
77+
// passed on the context
78+
_.template('<%= year() %>', {year: require('helper-year')});
79+
//=> 2014
80+
81+
// as an import
82+
var settings = {imports: {year: require('helper-year')}};
83+
_.template('<%= year() %>', {}, settings);
84+
//=> 2014
85+
```
86+
87+
## Contributing
88+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/helper-year/issues)
89+
90+
To request or contribute a helper to the [github.com/helpers][helpers] org, please read [this contributing guide][guide] to get started.
91+
92+
## Author
93+
94+
**Jon Schlinkert**
95+
96+
+ [github/jonschlinkert](https://github.com/jonschlinkert)
97+
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
98+
99+
## License
100+
Copyright (c) 2014 Jon Schlinkert
101+
Released under the MIT license
102+
103+
***
104+
105+
_This file was generated by [verb](https://github.com/assemble/verb) on December 01, 2014._
106+
107+
[assemble]: https://github.com/assemble/assemble
108+
[generator-verb]: https://github.com/assemble/generator-verb
109+
[handlebars-helpers]: https://github.com/assemble/handlebars-helpers/
110+
[handlebars]: https://github.com/wycats/handlebars.js/
111+
[helpers]: https://github.com/helpers
112+
[Lo-Dash]: https://lodash.com/
113+
[template]: https://github.com/jonschlinkert/template
114+
[underscore]: https://github.com/jashkenas/underscore
115+
[verb]: https://github.com/assemble/verb
116+
[guide]: https://github.com/helpers/requests

index.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*!
2+
* helper-year <https://github.com/jonschlinkert/helper-year>
3+
*
4+
* Copyright (c) 2014 Jon Schlinkert, contributors.
5+
* Licensed under the MIT license.
6+
*/
7+
8+
'use strict';
9+
10+
var year = require('year');
11+
12+
module.exports = function() {
13+
return year.apply(year, arguments);
14+
};

package.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "helper-year",
3+
"description": "Template helper for adding the current year. Good for adding dates for licenses, copyrights, last modified date, comment dates, etc. Works with handlebars, lo-dash or any template engine that has support for helper functions.",
4+
"version": "0.1.0",
5+
"homepage": "https://github.com/jonschlinkert/helper-year",
6+
"author": {
7+
"name": "Jon Schlinkert",
8+
"url": "https://github.com/jonschlinkert"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git://github.com/jonschlinkert/helper-year.git"
13+
},
14+
"bugs": {
15+
"url": "https://github.com/jonschlinkert/helper-year/issues"
16+
},
17+
"license": {
18+
"type": "MIT",
19+
"url": "https://github.com/jonschlinkert/helper-year/blob/master/LICENSE-MIT"
20+
},
21+
"main": "index.js",
22+
"engines": {
23+
"node": ">=0.10.0"
24+
},
25+
"scripts": {
26+
"test": "mocha -R spec"
27+
},
28+
"dependencies": {
29+
"year": "^0.2.0"
30+
},
31+
"devDependencies": {
32+
"handlebars": "^2.0.0",
33+
"lodash": "^2.4.1",
34+
"mocha": "*",
35+
"should": "*",
36+
"verb": "^0.3.7"
37+
},
38+
"keywords": [
39+
"date",
40+
"dates",
41+
"engine",
42+
"helper",
43+
"template",
44+
"year"
45+
]
46+
}

0 commit comments

Comments
 (0)