v1.5.1: don't cause ursa-optional to install due to error messages

This commit is contained in:
AJ ONeal 2018-07-13 04:33:17 -06:00
parent 023b0b7948
commit aae4ad4e3f
4 changed files with 27 additions and 6 deletions

View File

@ -23,6 +23,13 @@ node.js
npm install --save rsa-compat
```
For **more efficient** RSA key generation:
<small>(I dropped `ursa` as an "optional dependency" because the non-fatal error messages on unsupported platforms and node versions were confusing people, but I still recommend installing it)</small>
```bash
npm install --save ursa
```
**Node &lt; v6** support:
```bash

View File

@ -1,6 +1,16 @@
'use strict';
var ursa = require('ursa-optional');
var ursa;
try {
ursa = require('ursa');
} catch(e) {
try {
ursa = require('ursa-optional');
} catch(e2) {
throw e;
}
}
function notToJson() {
return undefined;

View File

@ -23,11 +23,15 @@ function create(deps) {
deps.NOBJ = {};
deps.RSA = RSA;
try {
RSA._URSA = require('ursa');
} catch(e) {
try {
RSA._URSA = require('ursa-optional');
} catch(e) {
// ignore
}
}
RSA.utils = require('./lib/key-utils.js');
RSA.utils.toWebsafeBase64 = function (b64) {

View File

@ -1,6 +1,6 @@
{
"name": "rsa-compat",
"version": "1.5.0",
"version": "1.5.1",
"description": "RSA utils that work on Windows, Mac, and Linux with or without C compiler",
"main": "node.js",
"bin": {
@ -42,10 +42,10 @@
"node-forge": "^0.6.41"
},
"optionalDependencies": {
"ursa-optional": "^0.9.4"
},
"trulyOptionalDependencies": {
"buffer-v6-polyfill": "^1.0.3",
"ursa": "^0.9.4"
"ursa": "^0.9.4",
"ursa-optional": "^0.9.4"
}
}