diff --git a/README.md b/README.md index 0caf41d..1882aa9 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,28 @@ This is useful for **certbot** and **letsencrypt**. Install ======= -``` -# node.js -npm install --save rsa-compat +node.js -# CLI +```bash +npm install --save rsa-compat +``` + +For **more efficient** RSA key generation: +(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) + +```bash +npm install --save ursa +``` + +**Node < v6** support: + +```bash +npm install --save buffer-v6-polyfill +``` + +### CLI + +```bash npm install --global rsa-compat ``` @@ -211,3 +228,9 @@ var web64 = RSA.generateCsrDerWeb64(keypair, [ 'example.com', 'www.example.com' console.log(web64); ``` + +ChangeLog: + +* v1.4.0 + * remove ursa as dependency (just causes confusion), but note in docs + * drop node < v6 support diff --git a/node.js b/node.js index 442b753..464fced 100644 --- a/node.js +++ b/node.js @@ -5,7 +5,11 @@ */ 'use strict'; -require('buffer-v6-polyfill'); +try { + require('buffer-v6-polyfill'); +} catch(e) { + /* ignore */ +} var RSA = {}; var NOBJ = {}; diff --git a/package.json b/package.json index d9fd971..7f6525b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rsa-compat", - "version": "1.3.2", + "version": "1.4.0", "description": "RSA utils that work on Windows, Mac, and Linux with or without C compiler", "main": "node.js", "bin": { @@ -39,10 +39,10 @@ }, "homepage": "https://git.coolaj86.com/coolaj86/rsa-compat.js#readme", "dependencies": { - "buffer-v6-polyfill": "^1.0.3", "node-forge": "^0.6.41" }, - "optionalDependencies": { + "trulyOptionalDependencies": { + "buffer-v6-polyfill": "^1.0.3", "ursa": "^0.9.4" } }