Socket
Socket
Sign inDemoInstall

tote-lib

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tote-lib - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

license

2

package.json
{
"name": "tote-lib",
"license": "MIT",
"version": "0.0.10",
"version": "0.0.11",
"main": "dist/index.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -7,3 +7,3 @@ # `tote-lib`

`tote-lib` exports three items.
`tote-lib` exports four items.

@@ -16,3 +16,3 @@ ### `Func`

```
```javascript
// import dependencies

@@ -58,3 +58,2 @@ import { Func, joi } from 'tote-lib'

| `send<object>` | `Function` | Set the JSON body |
| `_validate` | `Function` | Internal method for schema validation |

@@ -67,3 +66,3 @@ ##### Usage

```
```javascript
// get parameters

@@ -80,3 +79,3 @@ const {

```
```javascript
this.status(404)

@@ -89,3 +88,3 @@ ```

```
```javascript
this.send({

@@ -96,6 +95,19 @@ foo: 'bar'

### `joi`
### `Exception`
Look at [Joi docs](https://github.com/hapijs/joi).
`Exception` extends `Error` and lets you throw sensible errors from your functions.
#### Parameters
| Name | Type | Description | Default |
| --------- | -------- | -------------------- | --------------- |
| `message` | `string` | Error message or key | `unknown_error` |
| `status` | `number` | HTTP status code | `500` |
#### Usage
```javascript
throw new Exception('Email required', 400)
```
### `invoke`

@@ -114,3 +126,3 @@

```
```javascript
invoke('hello', {

@@ -125,1 +137,5 @@ headers: {

```
### `joi`
Look at [Joi docs](https://github.com/hapijs/joi).
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