roxify 1.16.14 → 1.16.15

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.
@@ -1 +1,2 @@
1
+ export declare function getNative(): any;
1
2
  export declare const native: any;
@@ -135,4 +135,27 @@ function getNativeModule() {
135
135
  }
136
136
  return nativeRequire(getNativePath());
137
137
  }
138
- export const native = getNativeModule();
138
+ let _native = null;
139
+ export function getNative() {
140
+ if (_native === null) {
141
+ try {
142
+ _native = getNativeModule();
143
+ }
144
+ catch {
145
+ _native = undefined;
146
+ }
147
+ }
148
+ return _native;
149
+ }
150
+ export const native = new Proxy({}, {
151
+ get(_, prop) {
152
+ const mod = getNative();
153
+ if (!mod)
154
+ return undefined;
155
+ return mod[prop];
156
+ },
157
+ has(_, prop) {
158
+ const mod = getNative();
159
+ return mod ? prop in mod : false;
160
+ },
161
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roxify",
3
- "version": "1.16.14",
3
+ "version": "1.16.15",
4
4
  "type": "module",
5
5
  "description": "Ultra-lightweight PNG steganography with native Rust acceleration. Encode binary data into PNG images with zstd compression.",
6
6
  "main": "dist/index.js",
@@ -84,10 +84,9 @@
84
84
  "license": "SEE LICENSE IN LICENSE",
85
85
  "devDependencies": {
86
86
  "@types/node": "^22.0.0",
87
- "pkg": "^5.8.1",
88
- "typescript": "^5.9.3",
89
87
  "esbuild": "^0.18.0",
90
- "pngjs": "^7.0.0"
88
+ "pkg": "^5.8.1",
89
+ "typescript": "^5.9.3"
91
90
  },
92
91
  "engines": {
93
92
  "node": ">=18.0.0"