https://github.com/gh-conf/gh-conf-response
gh-conf response formatter
https://github.com/gh-conf/gh-conf-response
generic-response gh-conf gh-conf-response github-config
Last synced: 6 months ago
JSON representation
gh-conf response formatter
- Host: GitHub
- URL: https://github.com/gh-conf/gh-conf-response
- Owner: gh-conf
- License: mit
- Created: 2019-01-27T17:44:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-21T04:55:34.000Z (almost 3 years ago)
- Last Synced: 2024-04-29T14:01:37.911Z (about 1 year ago)
- Topics: generic-response, gh-conf, gh-conf-response, github-config
- Language: JavaScript
- Size: 84 KB
- Stars: 2
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# gh-conf-response
[](https://github.com/gh-conf/gh-conf-response/actions/workflows/nodejs.yml)
[](https://www.npmjs.com/package/@gh-conf/gh-conf-response)
[](https://www.npmjs.com/package/@gh-conf/gh-conf-response)
[](https://github.com/gh-conf/gh-conf-response)
[](https://github.com/gh-conf/gh-conf-response/blob/master/LICENSE)
[](https://github.com/gh-conf/gh-conf-response/graphs/contributors)
[](https://github.com/gh-conf/gh-conf-response/commits/master)Response builder for gh-conf libraries
> Give us a :star: if you like our work :heart:
## Install
```
$ npm install @gh-conf/gh-conf-response
```## Usage
```javascript
const { formatError, formatSuccess } = require("@gh-conf/gh-conf-response");const successResponse = formatSuccess("Successfully passed", {
name: "formatSuccess",
});
console.log(successResponse);
// Output
/**
* {
* status: 'success',
* message: 'Successfully passed',
* data: {
* name: 'formatSuccess'
* }
* }
**/const errorResposne = formatError("Error running tests", { err: "101" });
console.log(successResponse);
// Output
/**
* {
* status: 'err',
* message: 'Error running tests',
* data: {
* err: '101'
* }
* }
**/
```## Contributing
Interested in contributing to this project?
You can log any issues or suggestion related to this library [here](https://github.com/gh-conf/gh-conf-response/issues/new)Read our contributing [guide](CONTRIBUTING.md) on getting started with contributing to the codebase