Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/njkleiner/micropub-parser
Parse Micropub requests
https://github.com/njkleiner/micropub-parser
indieweb javascript micropub nodejs
Last synced: 17 days ago
JSON representation
Parse Micropub requests
- Host: GitHub
- URL: https://github.com/njkleiner/micropub-parser
- Owner: njkleiner
- License: mit
- Created: 2020-05-05T06:28:11.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2020-05-31T10:03:09.000Z (over 4 years ago)
- Last Synced: 2024-11-13T15:26:31.616Z (2 months ago)
- Topics: indieweb, javascript, micropub, nodejs
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# micropub-parser ![Build Status](https://img.shields.io/travis/njkleiner/micropub-parser/develop) ![NPM Downloads](https://img.shields.io/npm/dm/@njkleiner/micropub-parser)
Parse [Micropub](https://www.w3.org/TR/micropub/) requests.
## Install
`$ npm install @njkleiner/micropub-parser`
## Usage
```javascript
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](https://git-send-email.io) to `[email protected]`.
## Authors
* [Noah Kleiner](https://github.com/njkleiner)
See also the list of [contributors](https://github.com/njkleiner/micropub-parser/contributors) who participated in this project.
## License
This project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for details.
## Acknowledgments
This module is essentially a JavaScript port of [p3k-micropub](https://github.com/aaronpk/p3k-micropub), written by [Aaron Parecki](https://github.com/aaronpk).