puvox-library 1.0.68 → 1.0.69

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.
@@ -3181,24 +3181,36 @@ const puvox_library =
3181
3181
  // }
3182
3182
  // },
3183
3183
  file: {
3184
- set_Fs(module) { this.module_fs = module;},
3185
- set_Path(module) { this.module_path = module;},
3186
- set_Os(module) { this.module_os = module;},
3184
+ // support for several native modules
3185
+ set_module(module) {
3186
+ // 'fs'
3187
+ if ('existsSync' in module && 'readFileSync' in module && 'writeFileSync' in module && 'unlinkSync' in module && 'mkdirSync' in module && 'readdirSync' in module && 'statSync' in module) {
3188
+ this.module_fs = module;
3189
+ }
3190
+ // 'path'
3191
+ else if ('isAbsolute' in module && 'basename' in module && 'dirname' in module) {
3192
+ this.module_path = module;
3193
+ }
3194
+ // 'os'
3195
+ else if ('hostname' in module && 'homedir' in module && 'tmpdir' in module && 'platform' in module) {
3196
+ this.module_os = module;
3197
+ }
3198
+ },
3187
3199
  fs() {
3188
3200
  if(!this.module_fs) {
3189
- throw new Error ('at first, set puvox_library.set_FS(require("fs"))');
3201
+ throw new Error ('at first, set puvox_library.set_module(require("fs"))');
3190
3202
  }
3191
3203
  return this.module_fs;
3192
3204
  },
3193
3205
  os() {
3194
3206
  if(!this.module_os) {
3195
- throw new Error ('at first, set puvox_library.set_FS(require("os"))');
3207
+ throw new Error ('at first, set puvox_library.set_module(require("os"))');
3196
3208
  }
3197
3209
  return this.module_os;
3198
3210
  },
3199
3211
  path() {
3200
3212
  if(!this.module_path) {
3201
- throw new Error ('at first, set puvox_library.set_FS(require("path"))');
3213
+ throw new Error ('at first, set puvox_library.set_module(require("path"))');
3202
3214
  }
3203
3215
  return this.module_path;
3204
3216
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puvox-library",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
4
4
  "description": "library-class-javascript",
5
5
  "main": "library_standard.js",
6
6
  "scripts": {