bireader 3.0.1 → 3.1.1

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.
Files changed (55) hide show
  1. package/README.md +91 -29
  2. package/dist/BiReader.d.ts +339 -0
  3. package/dist/BiReaderStream.d.ts +340 -0
  4. package/dist/BiWriter.d.ts +344 -0
  5. package/dist/BiWriterStream.d.ts +347 -0
  6. package/dist/aliases/BinaryAliasReader.d.ts +4678 -0
  7. package/dist/aliases/BinaryAliasWriter.d.ts +4648 -0
  8. package/dist/common.d.ts +90 -0
  9. package/{build/esm/common.d.ts → dist/core/BiBase.d.ts} +132 -221
  10. package/{build/cjs/common.d.ts → dist/core/BiBaseStream.d.ts} +197 -261
  11. package/dist/index.browser.d.ts +6738 -0
  12. package/dist/index.browser.js +11557 -0
  13. package/dist/index.browser.js.map +1 -0
  14. package/dist/index.cjs.d.ts +13439 -0
  15. package/dist/index.cjs.js +17364 -0
  16. package/dist/index.cjs.js.map +1 -0
  17. package/dist/index.d.ts +13439 -0
  18. package/dist/index.esm.d.ts +13439 -0
  19. package/dist/index.esm.js +17337 -0
  20. package/dist/index.esm.js.map +1 -0
  21. package/dist/indexBrowser.d.ts +19 -0
  22. package/dist/indexImport.d.ts +21 -0
  23. package/package.json +23 -14
  24. package/rollup.config.js +76 -0
  25. package/tsconfig.json +15 -0
  26. package/build/cjs/bireader.d.ts +0 -2372
  27. package/build/cjs/bireader.d.ts.map +0 -1
  28. package/build/cjs/bireader.js +0 -3060
  29. package/build/cjs/bireader.js.map +0 -1
  30. package/build/cjs/biwriter.d.ts +0 -2359
  31. package/build/cjs/biwriter.d.ts.map +0 -1
  32. package/build/cjs/biwriter.js +0 -3094
  33. package/build/cjs/biwriter.js.map +0 -1
  34. package/build/cjs/common.d.ts.map +0 -1
  35. package/build/cjs/common.js +0 -3615
  36. package/build/cjs/common.js.map +0 -1
  37. package/build/cjs/index.d.ts +0 -18
  38. package/build/cjs/index.d.ts.map +0 -1
  39. package/build/cjs/index.js +0 -30
  40. package/build/cjs/index.js.map +0 -1
  41. package/build/esm/bireader.d.ts +0 -2372
  42. package/build/esm/bireader.d.ts.map +0 -1
  43. package/build/esm/bireader.js +0 -3060
  44. package/build/esm/bireader.js.map +0 -1
  45. package/build/esm/biwriter.d.ts +0 -2359
  46. package/build/esm/biwriter.d.ts.map +0 -1
  47. package/build/esm/biwriter.js +0 -3094
  48. package/build/esm/biwriter.js.map +0 -1
  49. package/build/esm/common.d.ts.map +0 -1
  50. package/build/esm/common.js +0 -3615
  51. package/build/esm/common.js.map +0 -1
  52. package/build/esm/index.d.ts +0 -18
  53. package/build/esm/index.d.ts.map +0 -1
  54. package/build/esm/index.js +0 -30
  55. package/build/esm/index.js.map +0 -1
@@ -0,0 +1,19 @@
1
+ export { BiReader } from './BiReader.js';
2
+ export { BiWriter } from './BiWriter.js';
3
+ export { hexdump } from './common.js';
4
+ /**
5
+ * Not in use anymore.
6
+ * @since 3.0
7
+ * @deprecated Use ``BiReader`` instead.
8
+ */
9
+ export declare class bireader {
10
+ constructor();
11
+ }
12
+ /**
13
+ * Not in use anymore.
14
+ * @since 3.0
15
+ * @deprecated Use ``BiWriter`` instead.
16
+ */
17
+ export declare class biwriter {
18
+ constructor();
19
+ }
@@ -0,0 +1,21 @@
1
+ export { BiReader } from './BiReader.js';
2
+ export { BiWriter } from './BiWriter.js';
3
+ export { BiReaderStream } from './BiReaderStream.js';
4
+ export { BiWriterStream } from './BiWriterStream.js';
5
+ export { hexdump } from './common.js';
6
+ /**
7
+ * Not in use anymore.
8
+ * @since 3.0
9
+ * @deprecated Use ``BiReader`` instead.
10
+ */
11
+ export declare class bireader {
12
+ constructor();
13
+ }
14
+ /**
15
+ * Not in use anymore.
16
+ * @since 3.0
17
+ * @deprecated Use ``BiWriter`` instead.
18
+ */
19
+ export declare class biwriter {
20
+ constructor();
21
+ }
package/package.json CHANGED
@@ -1,28 +1,31 @@
1
1
  {
2
2
  "name": "bireader",
3
- "version": "3.0.1",
3
+ "version": "3.1.1",
4
4
  "description": "Read and write binary data in JavaScript",
5
- "module": "build/esm/index.js",
6
- "main": "build/cjs/index.js",
7
- "files": [
8
- "build"
9
- ],
5
+ "type": "module",
6
+ "main": "./dist/index.cjs.js",
7
+ "module": "./dist/index.esm.js",
8
+ "types": "./dist/index.d.ts",
9
+ "browser": "./dist/index.browser.js",
10
10
  "repository": {
11
11
  "type": "git",
12
12
  "url": "git+https://github.com/hearhellacopters/bireader.git"
13
13
  },
14
14
  "exports": {
15
15
  ".": {
16
- "import": "./build/esm/index.js",
17
- "require": "./build/cjs/index.js"
18
- },
19
- "./*": "./*"
16
+ "import": {
17
+ "browser": "./dist/index.browser.js",
18
+ "default": "./dist/index.esm.js"
19
+ },
20
+ "require": "./dist/index.cjs.js"
21
+ }
20
22
  },
21
23
  "scripts": {
22
- "build": "npm run clean && npm run build:esm && npm run build:cjs",
23
- "build:esm": "tsc --moduleResolution NodeNext --module NodeNext --outDir build/esm",
24
- "build:cjs": "tsc --moduleResolution node --module commonjs --outDir build/cjs",
25
- "clean": "rmdir /S /Q build"
24
+ "build": "npm run clean && npm run build:esm && npm run build:cjs && tsc --emitDeclarationOnly",
25
+ "build:rollup": "npm run clean && tsc --emitDeclarationOnly && rollup -c",
26
+ "build:esm": "tsc -p tsconfig.esm.json",
27
+ "build:cjs": "tsc -p tsconfig.cjs.json",
28
+ "clean": "rmdir /S /Q dist"
26
29
  },
27
30
  "keywords": [
28
31
  "buffer",
@@ -42,9 +45,15 @@
42
45
  },
43
46
  "homepage": "https://github.com/hearhellacopters/bireader#readme",
44
47
  "devDependencies": {
48
+ "@rollup/plugin-commonjs": "^28.0.3",
49
+ "@rollup/plugin-node-resolve": "^16.0.1",
50
+ "@rollup/plugin-replace": "^6.0.2",
51
+ "@rollup/plugin-typescript": "^12.1.2",
45
52
  "@types/mocha": "^10.0.2",
46
53
  "@types/node": "^20.7.0",
47
54
  "@typescript/lib-dom": "npm:@types/web@^0.0.115",
55
+ "rollup-plugin-dts": "^6.2.1",
56
+ "tslib": "^2.8.1",
48
57
  "typescript": "^5.2.2"
49
58
  },
50
59
  "engines": {
@@ -0,0 +1,76 @@
1
+ import typescript from '@rollup/plugin-typescript';
2
+ import dts from 'rollup-plugin-dts';
3
+ import { nodeResolve } from '@rollup/plugin-node-resolve';
4
+ import commonjs from '@rollup/plugin-commonjs';
5
+
6
+ export default [
7
+ // JS build (CJS + ESM)
8
+ {
9
+ input: './src/indexBrowser.ts',
10
+ output: [
11
+ {
12
+ file: './dist/index.browser.js',
13
+ format: 'esm',
14
+ sourcemap: true
15
+ }
16
+ ],
17
+ plugins: [
18
+ typescript({ tsconfig: './tsconfig.json' })
19
+ ]
20
+ },
21
+ {
22
+ input: './src/indexImport.ts',
23
+ output: [
24
+ {
25
+ file: './dist/index.cjs.js',
26
+ format: 'cjs',
27
+ exports: 'named',
28
+ sourcemap: true
29
+ },
30
+ {
31
+ file: './dist/index.esm.js',
32
+ format: 'esm',
33
+ sourcemap: true
34
+ }
35
+ ],
36
+ plugins: [
37
+ nodeResolve(),
38
+ commonjs(),
39
+ typescript({ tsconfig: './tsconfig.json' })
40
+ ],
41
+ external: ['fs', 'buffer'] // Node built-ins
42
+ },
43
+ // Types build
44
+ {
45
+ input: './dist/indexImport.d.ts',
46
+ output: {
47
+ file: './dist/index.esm.d.ts',
48
+ format: 'es'
49
+ },
50
+ plugins: [dts()]
51
+ },
52
+ {
53
+ input: './dist/indexImport.d.ts',
54
+ output: {
55
+ file: './dist/index.d.ts',
56
+ format: 'es'
57
+ },
58
+ plugins: [dts()]
59
+ },
60
+ {
61
+ input: './dist/indexBrowser.d.ts',
62
+ output: {
63
+ file: './dist/index.browser.d.ts',
64
+ format: 'es'
65
+ },
66
+ plugins: [dts()]
67
+ },
68
+ {
69
+ input: './dist/indexImport.d.ts',
70
+ output: {
71
+ file: './dist/index.cjs.d.ts',
72
+ format: 'cjs'
73
+ },
74
+ plugins: [dts()]
75
+ }
76
+ ];
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "declaration": true,
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "moduleResolution": "node",
9
+ "esModuleInterop": true
10
+ },
11
+ "include": ["src"],
12
+ "exclude": [
13
+ "node_modules"
14
+ ]
15
+ }