@reasondigital/library-nodejs-server-response
v0.0.8
Published
A utility to format responses for all HTTP requests for NodeJS projects
Downloads
6
Readme
Node JS SDK for PDT API schema
How to use
const Response = require('@reasondigital/library-nodejs-server-response');
const resp = new Response();
resp.addLink('self', 'https://abc.com');
let returnData = resp.getJSON();
//{"meta":{"error":null,"pagination":null,"status":200},"data":[],"links":{"self" : {"href" : "https://abc.com"}}}
Return data notes
Full details on the return type.
How to install repo
npm install @reasondigital/library-nodejs-server-response
How to lint locally
npm run-script lint
How to test locally
npm test
How to create documentation locally
npm run-script doc
How to publish new version
1* Bump semvar version in package.json
2* Run npm publish
Todo
- Add more tests
- Code coverage
- Deploy to NPM using CI/CD to run linting etc before publishing
- Typescript?