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

redisuri

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redisuri - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

package.json
{
"name": "redisuri",
"description": "Validate and parse Redis URI connection schemes",
"version": "1.1.1",
"version": "1.1.2",
"author": "AgileMD <hello@agilemd.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -11,7 +11,9 @@ redisuri

- `redis://`: **Required.** A protocol prefix to indentifying this as URI connection format.
- `auth@`: Optional. If specified, [AUTH password](http://redis.io/commands/AUTH) used to connect to the redis database.
- `host`: **Required.** A network location (e.g. hostname or IP address) of the redis server.
- `:port`: Optional. The server port assigned to the redis process. Defaults to `6379`.
- `/database`: Optional. An available redis database number. Defaults to `0`.
| Component | Required? | Description |
| :---------- | :----------- | :---------- |
| `redis://` | **Required** | A protocol prefix to indentifying this as URI connection format |
| `auth@` | | [AUTH password](http://redis.io/commands/AUTH) to connect to the redis instance |
| `host` | **Required** | A network location (e.g. hostname or IP address) of the redis server |
| `:port` | | The server port assigned to the redis process; defaults to `6379` |
| `/database` | | An available redis database number; defaults to `0` |

@@ -28,6 +30,6 @@

console.log(redisuri.validate('redis://localhost:6379'));
console.log(redisuri.parse('redis://localhost:6379'));
// => { auth: null, host: 'localhost', port: 6379, db: 0 }
console.log(redisuri.validate('redis://authstring@192.168.1.1:6379/7'));
console.log(redisuri.parse('redis://authstring@192.168.1.1:6379/7'));
// => { auth: authstring, host: '192.168.1.1', port: 6379, db: 7 }

@@ -38,3 +40,3 @@ ```

Ensures that the passed `uri` contains the `redis:` protocol and specifies a hostname. Throws a `TypeError` if either condition fails. If successful, returns the passed uri for convienient chaining with `redisURI.parse`.
Ensures that the passed `uri` contains the `redis:` protocol and specifies a hostname. Throws a `TypeError` if either condition fails. If successful, returns the uri for convienient wrapping with `parse`.

@@ -54,10 +56,15 @@ ```

### Tests
Production ready. To run the full unit test suite:
```
npm install
npm test
```
### Contribute
PRs are welcome! For bugs, please include a failing test which passes when your PR is applied.
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