boho 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "boho",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Encryption, authentication, Secure communication",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "import": "./dist/boho.js",
8
8
  "require": "./dist/boho.cjs"
9
9
  },
10
- "browser": "./dist/boho.js",
10
+ "browser": "./dist/boho.min.js",
11
+ "jsdelivr": "./dist/boho.min.js",
12
+ "unpkg": "./dist/boho.min.js",
11
13
  "keywords": [
12
14
  "SSL",
13
15
  "cipher",
@@ -29,13 +31,11 @@
29
31
  "devDependencies": {
30
32
  "@rollup/plugin-commonjs": "^26.0.1",
31
33
  "@rollup/plugin-node-resolve": "^15.2.3",
32
- "@rollup/plugin-replace": "^5.0.7",
33
34
  "@rollup/plugin-terser": "^0.4.4",
34
35
  "rollup": "^4.21.2"
35
36
  },
36
37
  "dependencies": {
37
- "buffer": "^6.0.3",
38
- "meta-buffer-pack": "^2.0.1"
38
+ "meta-buffer-pack": "^2.0.3"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "rollup -c",
package/rollup.config.js CHANGED
@@ -7,8 +7,8 @@ export default [
7
7
  input: './src/index.js',
8
8
  output: [
9
9
  {
10
- file: './dist/boho.iife.js',
11
- format: 'iife',
10
+ file: './dist/boho.min.js',
11
+ format: 'umd',
12
12
  name: 'Boho',
13
13
  sourcemap: true
14
14
  },
package/test/RAND.cjs ADDED
@@ -0,0 +1,18 @@
1
+ const { describe, it } = require('node:test');
2
+ const assert = require('node:assert');
3
+ const Boho = require('boho')
4
+
5
+ describe('RAND cjs', function () {
6
+ describe('for number', function () {
7
+ const num = 16
8
+ it('should return Uint8Array', function () {
9
+ assert.ok(Boho.RAND(num) instanceof Uint8Array)
10
+ })
11
+
12
+ it('should return number-bytes size of Uint8Array', function () {
13
+ assert.ok(Boho.RAND(num).byteLength === num)
14
+ })
15
+ })
16
+ })
17
+
18
+ console.log( 'buffer: hello', Boho.Buffer.from('hello'))
package/test/RAND.js CHANGED
@@ -1,4 +1,3 @@
1
- // import assert from 'assert/strict'
2
1
  import { describe, it } from 'node:test';
3
2
  import assert from 'node:assert';
4
3
  import Boho from 'boho'
@@ -15,3 +14,5 @@ describe('RAND ESM', function () {
15
14
  })
16
15
  })
17
16
  })
17
+
18
+ console.log( 'buffer: hello', Boho.Buffer.from('hello'))
@@ -15,7 +15,7 @@
15
15
  mocha.setup('bdd');
16
16
  mocha.checkLeaks();
17
17
  </script>
18
- <script src="../dist/boho.iife.js"></script>
18
+ <script src="../dist/boho.min.js"></script>
19
19
  <script>
20
20
 
21
21
  let assert = chai.assert;
@@ -7,12 +7,13 @@
7
7
  <title>Document</title>
8
8
  </head>
9
9
  <body>
10
- <p>this page include boho module two times. </p>
11
- <h1>1. IIFE: boho.min.js</h1>
10
+ <p>this page includes: </p>
11
+ <h1>1. UMD(IIFE): ../dist/boho.min.js</h1>
12
12
  <p>use global name: Boho </p>
13
- <p>Boho has props: sha256, Buffer, RAND , MBP,, </p>
14
- <h1>2. ES Module: boho.esm.js</h1>
15
- <script src="../dist/boho.iife.js"></script>
13
+ <p>Boho has props: sha256, Buffer, RAND , MBP. </p>
14
+ <h1>2. ES Module: ../dist/boho.js</h1>
15
+
16
+ <script src="../dist/boho.min.js"></script>
16
17
  <script>
17
18
  // console.log( Boho )
18
19
  console.log('min.js: sha256.hash("hi")', Boho.sha256.hash('hi'))