Comparing version 1.1.0 to 1.1.1
@@ -25,3 +25,9 @@ ## 1.0.0 | ||
- Add support for ArrayBuffer and TypedArray. | ||
- Change some inner object names in case of confusion for partially import. | ||
- Change some inner object names in case of confusion for partially import. | ||
## 1.1.1 | ||
**2019-07-15** | ||
- Remove loader.mjs, insead using package.json type field for ECMAScript Modules. | ||
- Update README.md. |
{ | ||
"name": "crypto-es", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "A cryptography algorithms library", | ||
@@ -35,2 +35,3 @@ "keywords": [ | ||
], | ||
"type": "module", | ||
"main": "lib/index.js", | ||
@@ -42,3 +43,3 @@ "files": [ | ||
"test": "jest", | ||
"debug": "node --experimental-modules --loader ./loader.mjs __tests__/debug.js" | ||
"debug": "node --experimental-modules __tests__/debug.js" | ||
}, | ||
@@ -45,0 +46,0 @@ "repository": { |
@@ -17,3 +17,3 @@ # CryptoES | ||
or | ||
or: | ||
@@ -24,4 +24,22 @@ ``` | ||
You may need [Babel](https://babeljs.io/) and [Webpack](https://webpack.js.org/) for old IE browsers, or [Loader hook](https://nodejs.org/dist/latest-v10.x/docs/api/esm.html#esm_loader_hooks) for Node.js. | ||
--- | ||
In Node.js projects, we recommend you to use ECMAScript Modules insead of CommonJS: | ||
``` | ||
// package.json | ||
{ | ||
"type": "module" | ||
} | ||
``` | ||
``` | ||
# In same folder as above package.json | ||
node --experimental-modules my-app.js # Runs as ES module | ||
``` | ||
[See details](<https://nodejs.org/dist/latest-v12.x/docs/api/esm.html>) | ||
--- | ||
Then you can import CryptoES: | ||
@@ -31,16 +49,26 @@ | ||
import CryptoES from 'crypto-es'; | ||
const hash = CryptoES.MD5("Message"); | ||
const rst = CryptoES.MD5("Message").toString(); | ||
``` | ||
Or partially import the functions to reduce the package weight: | ||
Or partially import the function to reduce the package weight: | ||
``` | ||
import { MD5 } from 'crypto-es/md5.js'; | ||
const hash = MD5("Message"); | ||
import { MD5 } from 'crypto-es/lib/md5.js'; | ||
const rst = MD5("Message").toString(); | ||
``` | ||
## Quick-start Guide | ||
## Guide | ||
> Just the same as [CryptoJS](https://code.google.com/archive/p/crypto-js/) | ||
--- | ||
- [Hashers](###Hashers) | ||
- [HMAC](#HMAC) | ||
- [Ciphers](#Ciphers) | ||
- [Encoders](#Encoders) | ||
- [ArrayBuffer and TypedArray](#ArrayBuffer and TypedArray) | ||
--- | ||
### Hashers | ||
@@ -47,0 +75,0 @@ |
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
167770
437
Yes