项目作者: gh-conf

项目描述 :
gh-conf response formatter
高级语言: JavaScript
项目地址: git://github.com/gh-conf/gh-conf-response.git
创建时间: 2019-01-27T17:44:38Z
项目社区:https://github.com/gh-conf/gh-conf-response

开源协议:MIT License

下载


gh-conf-response

Build
@gh-conf/gh-conf-response"">NPM Version
@gh-conf/gh-conf-response"">NPM Downloads
Github Repo Size
LICENSE
Contributors
Commit

Response builder for gh-conf libraries

Give us a :star: if you like our work :heart:

Install

  1. $ npm install @gh-conf/gh-conf-response

Usage

  1. const { formatError, formatSuccess } = require("@gh-conf/gh-conf-response");
  2. const successResponse = formatSuccess("Successfully passed", {
  3. name: "formatSuccess",
  4. });
  5. console.log(successResponse);
  6. // Output
  7. /**
  8. * {
  9. * status: 'success',
  10. * message: 'Successfully passed',
  11. * data: {
  12. * name: 'formatSuccess'
  13. * }
  14. * }
  15. **/
  16. const errorResposne = formatError("Error running tests", { err: "101" });
  17. console.log(successResponse);
  18. // Output
  19. /**
  20. * {
  21. * status: 'err',
  22. * message: 'Error running tests',
  23. * data: {
  24. * err: '101'
  25. * }
  26. * }
  27. **/

Contributing

Interested in contributing to this project?
You can log any issues or suggestion related to this library here

Read our contributing guide on getting started with contributing to the codebase