+1
-1
| { | ||
| "name": "cf-errors", | ||
| "version": "0.1.5", | ||
| "version": "0.1.6", | ||
| "description": "Extensible error library", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
+11
-11
@@ -7,3 +7,3 @@ cf-errors | ||
| ## Installation | ||
| ##Installation | ||
| ```javascript | ||
@@ -24,3 +24,3 @@ $ npm install cf-errors | ||
| <a name="constructor" /> | ||
| ## Creating an error | ||
| ##Creating an error | ||
| ```javascript | ||
@@ -52,3 +52,3 @@ var CFError = require('cf-errors'); | ||
| <a name="cause" /> | ||
| ## Extending with a previous error | ||
| ##Extending with a previous error | ||
| ```javascript | ||
@@ -62,3 +62,3 @@ var extendedError = new CFError({ | ||
| <a name="stack" /> | ||
| ## Printing the stack | ||
| ##Printing the stack | ||
| will print the stack of all previous errors too | ||
@@ -70,3 +70,3 @@ ```javascript | ||
| <a name="toString" /> | ||
| ## toString() | ||
| ##toString() | ||
| Will print the whole chain of errors in a nice way. </br> | ||
@@ -81,3 +81,3 @@ You can always override it if you want. | ||
| <a name="predefined" /> | ||
| ## Predefined Error Types | ||
| ##Predefined Error Types | ||
| ```javascript | ||
@@ -89,3 +89,3 @@ var CFError = require('cf-errors'); | ||
| They are actually just simple objects so using the extension capability allows us to use them easily and extend them when needed. | ||
| #### Http Errors | ||
| ####Http Errors | ||
| All http errors are available. | ||
@@ -109,7 +109,7 @@ They will contain a field name 'statusCode' for your use. | ||
| ``` | ||
| #### Node Errors | ||
| ####Node Errors | ||
| All node.js core errors are also available using the Errors.Node object. | ||
| <a name="inherit" /> | ||
| ## Inheriting the previous error type | ||
| ##Inheriting the previous error type | ||
| Creating an error with the same name as its cause can be achieved using 'Inherit' as the error name. | ||
@@ -132,3 +132,3 @@ ```javascript | ||
| <a name="getfirstvalue" /> | ||
| ## Getting the value of the first occurrence of a field in the chain | ||
| ##Getting the value of the first occurrence of a field in the chain | ||
| Sometimes you will populate an error with a field and wrap it with an additional error. In order to get the value of the field you will need to recursively go over the whole chain. </br> | ||
@@ -145,4 +145,4 @@ In order to get the first value of a field in the chain use 'getFirstValue' function. | ||
| <a name="tests" /> | ||
| ## Running the tests | ||
| ##Running the tests | ||
| 'npm test' or 'gulp unit_test' | ||
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
33654
-0.03%