@njkleiner/micropub-parser

1.0.2 • Public • Published

micropub-parser

Parse Micropub requests.

Install

$ npm install @njkleiner/micropub-parser

Usage

const micropub = require('@njkleiner/micropub-parser');

micropub.parseForm({
    'h': 'entry',
    'access_token': '2ab96390c7dbe3439de74d0c9b0b1767',
    'content': 'Hello World',
    'mp-slug': 'hello-world'
});
// => {'type': 'h-entry', 'action': 'create', 'properties': {'content': ['Hello World']}, 'commands': {'slug': ['hello-world']}}

micropub.parseJSON({
    'type': [
        'h-entry'
    ],
    'properties': {
        'content': [
            'Hello World'
        ],
        'mp-slug': [
            'hello-world'
        ]
    }
});
// => {'type': 'h-entry', 'action': 'create', 'properties': {'content': ['Hello World']}, 'commands': {'slug': ['hello-world']}}

Contributing

You can contribute to this project by sending patches to noah@njkleiner.com.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

Acknowledgments

This module is essentially a JavaScript port of p3k-micropub, written by Aaron Parecki.

Readme

Keywords

Package Sidebar

Install

npm i @njkleiner/micropub-parser

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

10.3 kB

Total Files

4

Last publish

Collaborators

  • njkleiner