1
- # vfile-frontmatter
1
+ # vfile-matter
2
2
3
3
[ ![ Build] [ build-badge ]] [ build ]
4
4
[ ![ Coverage] [ coverage-badge ]] [ coverage ]
8
8
[ ![ Backers] [ backers-badge ]] [ collective ]
9
9
[ ![ Chat] [ chat-badge ]] [ chat ]
10
10
11
- Parse the YAML frontmatter in a [ ` vfile ` ] [ vfile ] .
11
+ Parse the YAML front matter in a [ ` vfile ` ] [ vfile ] .
12
12
13
13
## Install
14
14
15
15
[ npm] [ ] :
16
16
17
17
``` sh
18
- npm install vfile-frontmatter
18
+ npm install vfile-matter
19
19
```
20
20
21
21
## Use
@@ -33,11 +33,11 @@ And our script, `example.js`, looks like so:
33
33
34
34
``` js
35
35
var vfile = require (' to-vfile' )
36
- var frontmatter = require (' vfile-frontmatter ' )
36
+ var matter = require (' vfile-matter ' )
37
37
38
38
var file = vfile .readSync (' example.html' )
39
39
40
- frontmatter (file, {strip: true })
40
+ matter (file, {strip: true })
41
41
42
42
console .log (file .data )
43
43
console .log (String (file))
@@ -46,7 +46,7 @@ console.log(String(file))
46
46
Now, running our script (` node example ` ) yields:
47
47
48
48
``` js
49
- { frontmatter : { title: ' Hello, world!' } }
49
+ { matter : { title: ' Hello, world!' } }
50
50
```
51
51
52
52
``` html
@@ -55,20 +55,20 @@ Now, running our script (`node example`) yields:
55
55
56
56
## API
57
57
58
- ### ` frontmatter (file[, options])`
58
+ ### ` matter (file[, options])`
59
59
60
- Parse the YAML frontmatter in a [ ` vfile ` ] [ vfile ] , and add it as
61
- ` file.data.frontmatter ` .
60
+ Parse the YAML front matter in a [ ` vfile ` ] [ vfile ] , and add it as
61
+ ` file.data.matter ` .
62
62
63
- If no frontmatter is found in the file, nothing happens, except that
64
- ` file.data.frontmatter ` is set to an empty object (` {} ` ).
63
+ If no matter is found in the file, nothing happens, except that
64
+ ` file.data.matter ` is set to an empty object (` {} ` ).
65
65
66
66
###### Parameters
67
67
68
68
* ` file ` ([ ` VFile ` ] [ vfile ] )
69
69
— Virtual file
70
70
* ` options.strip ` (` boolean ` , default: ` false ` )
71
- — Remove the YAML frontmatter from the file
71
+ — Remove the YAML front matter from the file
72
72
73
73
###### Returns
74
74
@@ -90,21 +90,21 @@ abide by its terms.
90
90
91
91
<!-- Definitions -->
92
92
93
- [ build-badge ] : https://img.shields.io/travis/vfile/vfile-frontmatter .svg
93
+ [ build-badge ] : https://img.shields.io/travis/vfile/vfile-matter .svg
94
94
95
- [ build ] : https://travis-ci.org/vfile/vfile-frontmatter
95
+ [ build ] : https://travis-ci.org/vfile/vfile-matter
96
96
97
- [ coverage-badge ] : https://img.shields.io/codecov/c/github/vfile/vfile-frontmatter .svg
97
+ [ coverage-badge ] : https://img.shields.io/codecov/c/github/vfile/vfile-matter .svg
98
98
99
- [ coverage ] : https://codecov.io/github/vfile/vfile-frontmatter
99
+ [ coverage ] : https://codecov.io/github/vfile/vfile-matter
100
100
101
- [ downloads-badge ] : https://img.shields.io/npm/dm/vfile-frontmatter .svg
101
+ [ downloads-badge ] : https://img.shields.io/npm/dm/vfile-matter .svg
102
102
103
- [ downloads ] : https://www.npmjs.com/package/vfile-frontmatter
103
+ [ downloads ] : https://www.npmjs.com/package/vfile-matter
104
104
105
- [ size-badge ] : https://img.shields.io/bundlephobia/minzip/vfile-frontmatter .svg
105
+ [ size-badge ] : https://img.shields.io/bundlephobia/minzip/vfile-matter .svg
106
106
107
- [ size ] : https://bundlephobia.com/result?p=vfile-frontmatter
107
+ [ size ] : https://bundlephobia.com/result?p=vfile-matter
108
108
109
109
[ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
110
110
0 commit comments