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
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
```bash
|
||||
|
|
|
@ -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;
|
||||
|
|
8
node.js
8
node.js
|
@ -24,9 +24,13 @@ function create(deps) {
|
|||
deps.RSA = RSA;
|
||||
|
||||
try {
|
||||
RSA._URSA = require('ursa-optional');
|
||||
RSA._URSA = require('ursa');
|
||||
} catch(e) {
|
||||
// ignore
|
||||
try {
|
||||
RSA._URSA = require('ursa-optional');
|
||||
} catch(e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
RSA.utils = require('./lib/key-utils.js');
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue