v1.5.1: don't cause ursa-optional to install due to error messages
This commit is contained in:
parent
023b0b7948
commit
aae4ad4e3f
|
@ -23,6 +23,13 @@ node.js
|
||||||
npm install --save rsa-compat
|
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 < v6** support:
|
**Node < v6** support:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
@ -1,6 +1,16 @@
|
||||||
'use strict';
|
'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() {
|
function notToJson() {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|
8
node.js
8
node.js
|
@ -24,9 +24,13 @@ function create(deps) {
|
||||||
deps.RSA = RSA;
|
deps.RSA = RSA;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
RSA._URSA = require('ursa-optional');
|
RSA._URSA = require('ursa');
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
// ignore
|
try {
|
||||||
|
RSA._URSA = require('ursa-optional');
|
||||||
|
} catch(e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RSA.utils = require('./lib/key-utils.js');
|
RSA.utils = require('./lib/key-utils.js');
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "rsa-compat",
|
"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",
|
"description": "RSA utils that work on Windows, Mac, and Linux with or without C compiler",
|
||||||
"main": "node.js",
|
"main": "node.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -42,10 +42,10 @@
|
||||||
"node-forge": "^0.6.41"
|
"node-forge": "^0.6.41"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"ursa-optional": "^0.9.4"
|
|
||||||
},
|
},
|
||||||
"trulyOptionalDependencies": {
|
"trulyOptionalDependencies": {
|
||||||
"buffer-v6-polyfill": "^1.0.3",
|
"buffer-v6-polyfill": "^1.0.3",
|
||||||
"ursa": "^0.9.4"
|
"ursa": "^0.9.4",
|
||||||
|
"ursa-optional": "^0.9.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue