Skip to content

Commit

Permalink
adds support for empty front matter
Browse files Browse the repository at this point in the history
- closes #65
- upgraded to es6
  • Loading branch information
jonschlinkert committed Apr 2, 2018
1 parent 8a2fb32 commit 24ac1fa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ node_js:
- '8'
- '7'
- '6'
- '5'
- '4'
7 changes: 6 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"strip-bom-string": "^1.0.0"
},
"devDependencies": {
"ansi-magenta": "^0.1.1",
"ansi-green": "^0.1.1",
"benchmarked": "^2.0.0",
"coffeescript": "^2.2.3",
"delimiter-regex": "^2.0.0",
Expand Down Expand Up @@ -107,5 +107,10 @@
"types": "gray-matter.d.ts",
"browser": {
"fs": false
},
"eslintConfig": {
"rules": {
"no-console": 0
}
}
}
4 changes: 2 additions & 2 deletions examples/excerpt-separator.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const matter = require('..');
const magenta = require('ansi-magenta');
const green = require('ansi-green');

console.log(magenta('/* excerpt with custom separator */'));
console.log(green('/* excerpt with custom separator */'));
const file = matter([
'---',
'foo: bar',
Expand Down
6 changes: 3 additions & 3 deletions examples/excerpt-stringify.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const matter = require('..');
const magenta = require('ansi-magenta');
const green = require('ansi-green');

const file = matter([
'---',
Expand All @@ -10,9 +10,9 @@ const file = matter([
'This is content'
].join('\n'), {excerpt_separator: '<!-- sep -->'});

console.log(magenta('/* file object, with excerpt */'));
console.log(green('/* file object, with excerpt */'));
console.log(file);

console.log();
console.log(magenta('/* stringified, with excerpt */'));
console.log(green('/* stringified, with excerpt */'));
console.log(file.stringify());
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
"main": "index.js",
"engines": {
"node": ">=6.0"
"node": ">=4.0"
},
"scripts": {
"test": "mocha"
Expand All @@ -42,7 +42,6 @@
},
"devDependencies": {
"ansi-green": "^0.1.1",
"ansi-magenta": "^0.1.1",
"benchmarked": "^2.0.0",
"coffeescript": "^2.2.3",
"delimiter-regex": "^2.0.0",
Expand Down

0 comments on commit 24ac1fa

Please sign in to comment.