Skip to content

Commit

Permalink
Merge pull request #2 from Fdawgs/chore/tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Feb 7, 2023
2 parents 0fad9cc + 336a190 commit f51b35a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
## Intro

The `fastify-json-to-xml` plugin adds an `onSend` hook that supports serialising 'application/json' responses as XML if the `Accept` HTTP request header only includes 'application/xml' or if it explicitly includes the 'application/xml' media type before 'application/json'.
The `fastify-json-to-xml` plugin adds an `onSend` hook that supports serialising 'application/json' responses as XML if:

- The `Accept` HTTP request header only includes 'application/xml'
- The `Accept` HTTP request header explicitly includes the 'application/xml' media type before 'application/json'

## Installation

Expand All @@ -24,7 +27,6 @@ npm i fastify-json-to-xml

```js
const Fastify = require("fastify");
const accepts = require("@fastify/accepts");
const jsonToXml = require("fastify-json-to-xml");

const server = Fastify();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fastify-json-to-xml",
"version": "1.0.0",
"description": "",
"description": "Fastify plugin to serialise JSON responses to XML",
"keywords": [
"fastify",
"json",
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const fp = require("fastify-plugin");
// eslint-disable-next-line import/no-extraneous-dependencies
const accepts = require("accepts");
const js2xmlparser = require("js2xmlparser");
const secJSON = require("secure-json-parse");
Expand Down

0 comments on commit f51b35a

Please sign in to comment.