Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

help-me-respond

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

help-me-respond - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "help-me-respond",
"version": "1.0.2",
"version": "1.0.3",
"description": "Simple node response helper",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,4 +12,7 @@ ## Help me respond

2. Setup config
Create config folder and put default.json in it. You will need to add a file with the following to your folder. File naming is up to you :) This is a basic setup for the [i18n-nodejs]: https://github.com/eslam-mahmoud/i18n-nodejs
Create a config folder and put **default.json** in it. (more cool config setup in https://github.com/lorenwest/node-config).
You will need to add the following to your **default.json** file. File naming is up to you :) This is a basic setup for the i18n-nodejs - https://github.com/eslam-mahmoud/i18n-nodejs
```

@@ -30,3 +33,3 @@ {

"NOT_OWNER": {
"en":"You are not the owner"
"en": "You are not the owner"
}

@@ -36,3 +39,5 @@ }

4. Setup friendly messages. Some messages returned from the server are too technical for the user. So we would like to differentiate between those messages and user friendly messages. Simply add the following to your defaul.json configuration file. Now you can add message names in the friendlyMessages array.
4. Setup friendly messages.
Some messages returned from the server are too technical for the user. So we would like to differentiate between those messages and user friendly messages. Simply add the following to your **default.json** configuration file. Now you can add message names in the friendlyMessages array.
```

@@ -46,3 +51,3 @@ {

Once the message name is in the above array, the response will have a key friendlyMessage which makes it easy for frontend to differentiate between messages
Once the message name is in the above array, the response will have a key **friendlyMessage** which makes it easy for front-end to differentiate between messages.

@@ -53,3 +58,3 @@ ## API

**msg** - string message, Error object, any other object
**headers** - array with http headers. If none provided the only header set by the library will bw *Content-type*: *application/json*
**headers** - array with http headers. If none provided the only header set by the library will be *Content-type*: *application/json*

@@ -56,0 +61,0 @@ #### http400(res, msg, headers)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc