bireader 4.0.2 → 4.0.4

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,34 +1,32 @@
1
1
  {
2
2
  "name": "bireader",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "Read and write binary data in JavaScript",
5
- "main": "./dist/index.cjs.js",
6
- "module": "./dist/index.esm.js",
7
- "types": "./dist/index.d.ts",
8
- "browser": "./dist/index.browser.js",
5
+ "type": "module",
6
+ "main": "./dist/cjs/index.js",
7
+ "module": "./dist/esm/indexImport.js",
8
+ "browser": "./dist/esm/indexBrowser.js",
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/hearhellacopters/bireader.git"
12
12
  },
13
13
  "exports": {
14
14
  ".": {
15
- "types": {
16
- "require": "./dist/index.cjs.d.ts",
17
- "import": "./dist/index.esm.d.ts"
18
- },
19
- "browser": "./dist/index.browser.js",
20
- "node": {
21
- "require": "./dist/index.cjs.js",
22
- "import": "./dist/index.esm.js"
23
- },
24
- "default": "./dist/index.cjs.js"
15
+ "require": "./dist/cjs/index.js",
16
+ "import": "./dist/esm/indexImport.js",
17
+ "browser": "./dist/esm/indexBrowser.js"
25
18
  }
26
19
  },
20
+ "files": [
21
+ "dist"
22
+ ],
27
23
  "scripts": {
28
- "build": "npm run clean && npm run build:esm && npm run build:cjs && tsc --emitDeclarationOnly",
29
- "build:rollup": "npm run clean && tsc --emitDeclarationOnly && rollup -c",
24
+ "build": "npm run clean && rollup -c",
25
+ "build:rollup": "npm run build",
26
+ "build:ts": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:types",
30
27
  "build:esm": "tsc -p tsconfig.esm.json",
31
28
  "build:cjs": "tsc -p tsconfig.cjs.json",
29
+ "build:types": "tsc -p tsconfig.d.ts.json",
32
30
  "clean": "rimraf dist",
33
31
  "test": "mocha --require ts-node/register test/**/*.test.ts ",
34
32
  "test:fallback": "mocha --require ts-node/register test/**/*.test.ts -- FALLBACK=true"
@@ -49,10 +47,6 @@
49
47
  "bugs": {
50
48
  "url": "https://github.com/hearhellacopters/bireader/issues"
51
49
  },
52
- "engines": {
53
- "node": ">=18",
54
- "browsers": "Chrome >=113, Firefox >=117, Safari >=18"
55
- },
56
50
  "homepage": "https://github.com/hearhellacopters/bireader#readme",
57
51
  "devDependencies": {
58
52
  "@rollup/plugin-commonjs": "^28.0.3",
@@ -62,13 +56,14 @@
62
56
  "@types/chai": "^5.2.3",
63
57
  "@types/chai-as-promised": "^8.0.2",
64
58
  "@types/mocha": "^10.0.2",
65
- "@types/node": "^24.10.9",
59
+ "@types/node": "^24.12.2",
66
60
  "@typescript/lib-dom": "npm:@types/web@^0.0.115",
67
61
  "chai": "^6.2.2",
68
62
  "chai-as-promised": "^8.0.2",
69
63
  "mocha": "^11.7.5",
70
64
  "rimraf": "^6.1.3",
71
65
  "rollup-plugin-dts": "^6.2.1",
66
+ "rollup-plugin-polyfill-node": "^0.13.0",
72
67
  "ts-node": "^10.9.2",
73
68
  "tslib": "^2.8.1",
74
69
  "typescript": "^5.2.2"
package/_test_reader.cjs DELETED
@@ -1,38 +0,0 @@
1
-
2
- const { BiWriter, BiReaderAsync } = require('./dist/index.cjs.js');
3
-
4
- const FLOAT32_MAX = 3.4028234663852886e+38;
5
-
6
- const FLOAT32_MIN = -FLOAT32_MAX;
7
-
8
- const FLOAT64_MAX = Number.MAX_VALUE;
9
-
10
- const FLOAT64_MIN = -FLOAT64_MAX;
11
-
12
- const hasBigInt = typeof BigInt === 'function';
13
-
14
- const MIN_SAFE_BIGINT = hasBigInt ? BigInt(Number.MIN_SAFE_INTEGER) : 0;
15
-
16
- const MAX_SAFE_BIGINT = hasBigInt ? BigInt(Number.MAX_SAFE_INTEGER) : 0;
17
-
18
- const buffer = Buffer.from([0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07]);
19
-
20
- const array = new Uint8Array([0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07]);
21
-
22
- const array2 = new Uint8Array(array);
23
-
24
- const array3 = new Uint8Array(buffer);
25
-
26
- const windowSize = 1500;
27
-
28
- const dif = 2000;
29
-
30
- var increaseSize = 0;
31
-
32
- if(windowSize != 0 && windowSize > dif) {
33
-
34
- }
35
-
36
-
37
- console.log(increaseSize);
38
-
package/_test_writer.mjs DELETED
@@ -1,8 +0,0 @@
1
- import {BiReader, BiReaderAsync, BiWriterStream, BiWriter, hexdump} from './dist/index.esm.js';
2
- //const filePath = "./test.bin";
3
- (async function () {
4
- const bw = new BiReaderAsync(Buffer.alloc(8));
5
- await bw.open()
6
- await bw.writeInt64BE(-9174043789562546760n);
7
- console.log(await bw.get())
8
- })();