Go to file
2023-07-11 00:41:43 +02:00
.vscode fix(core): update 2019-09-04 15:45:18 +02:00
test fix(core): update 2019-09-04 15:45:18 +02:00
ts fix(core): update 2019-09-04 15:45:18 +02:00
.gitignore fix(core): update 2019-09-04 14:13:42 +02:00
.gitlab-ci.yml fix(core): update 2019-09-04 14:13:42 +02:00
npmextra.json switch to new org scheme 2023-07-10 02:55:58 +02:00
package-lock.json 2.0.4 2019-09-04 15:45:18 +02:00
package.json switch to new org scheme 2023-07-10 02:55:58 +02:00
pnpm-lock.yaml switch to new org scheme 2023-07-11 00:41:43 +02:00
README.md fix(core): update 2019-09-04 14:19:43 +02:00

@pushrocks/smartfm

frontmatter done right

Please consider following us on https://beta.news/lossless to subscribe to infos on changes and updates.

Status for master

build status coverage report npm downloads per month Known Vulnerabilities TypeScript node JavaScript Style Guide

Usage

We recommend TypeScript for best in class Intellisense.

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
})

For further information read the linked docs at the top of this readme.

MIT licensed | © Lossless GmbH | By using this npm module you agree to our privacy policy

repo-footer