| 
									
										
										
										
											2019-09-04 14:13:42 +02:00
										 |  |  | # @pushrocks/smartfm
 | 
					
						
							| 
									
										
										
										
											2016-11-14 13:33:16 +01:00
										 |  |  | frontmatter done right | 
					
						
							| 
									
										
										
										
											2016-11-13 23:11:49 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-04 14:13:42 +02:00
										 |  |  | ## Availabililty and Links
 | 
					
						
							|  |  |  | * [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartfm) | 
					
						
							|  |  |  | * [gitlab.com (source)](https://gitlab.com/pushrocks/smartfm) | 
					
						
							|  |  |  | * [github.com (source mirror)](https://github.com/pushrocks/smartfm) | 
					
						
							|  |  |  | * [docs (typedoc)](https://pushrocks.gitlab.io/smartfm/) | 
					
						
							| 
									
										
										
										
											2016-11-13 23:11:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## Status for master
 | 
					
						
							|  |  |  | [](https://gitlab.com/pushrocks/smartfm/commits/master) | 
					
						
							|  |  |  | [](https://gitlab.com/pushrocks/smartfm/commits/master) | 
					
						
							| 
									
										
										
										
											2019-09-04 14:13:42 +02:00
										 |  |  | [](https://www.npmjs.com/package/@pushrocks/smartfm) | 
					
						
							|  |  |  | [](https://snyk.io/test/npm/@pushrocks/smartfm) | 
					
						
							|  |  |  | [](https://nodejs.org/dist/latest-v10.x/docs/api/) | 
					
						
							|  |  |  | [](https://nodejs.org/dist/latest-v10.x/docs/api/) | 
					
						
							|  |  |  | [](https://prettier.io/) | 
					
						
							| 
									
										
										
										
											2016-11-14 13:33:16 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-27 02:01:18 +02:00
										 |  |  | ## Usage
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-14 13:33:16 +01:00
										 |  |  | We recommend TypeScript for best in class Intellisense. | 
					
						
							| 
									
										
										
										
											2016-11-13 23:11:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | ```javascript | 
					
						
							|  |  |  | import * as smartfm from * smartfm | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let markdownfile = `--- | 
					
						
							|  |  |  | testKey: testValue | 
					
						
							|  |  |  | testKey2: testValue2 | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | # some markdown`
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // easy methods | 
					
						
							|  |  |  | let parsedData = smartfm.parse(markdownfile) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // parsedData will be object | 
					
						
							|  |  |  | /* | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         data: { | 
					
						
							|  |  |  |             testKey: testValue, | 
					
						
							|  |  |  |             testKey2: testValue2 | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         content: '# some markdown', | 
					
						
							|  |  |  |         orig: '---\ntestKey: testValue\ntestKey2: testValue2\n---\n# some markdown' | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let newFmString = smartfm.stringify('My awesome string', {testKey1: testValue1}) | 
					
						
							|  |  |  | // newFmString will be '---\testKey1: testValue1\n---\nMyawesomeString' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # class Smartfm
 | 
					
						
							|  |  |  | let mySmartfm = new smartfm.Smartfm({ | 
					
						
							|  |  |  |     fmType: 'yaml' // can be yaml or json atm | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-04 14:13:42 +02:00
										 |  |  | For further information read the linked docs at the top of this readme. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
 | 
					
						
							|  |  |  | | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [](https://maintainedby.lossless.com) |