Comparing version 1.1.1 to 1.1.2
{ | ||
"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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6087
67
0