@environment-safe/file 0.0.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.
- package/.babelrc.cjs +18 -0
- package/.eslintrc.cjs +42 -0
- package/.husky/pre-commit +11 -0
- package/.import-config.json +5 -0
- package/.jsdoc.json +15 -0
- package/LICENSE +20 -0
- package/README.md +95 -0
- package/containers/development.dockerfile +11 -0
- package/containers/production.dockerfile +11 -0
- package/containers/test.dockerfile +11 -0
- package/dist/buffer.cjs +77 -0
- package/dist/index.cjs +599 -0
- package/index.html +74 -0
- package/package.json +107 -0
- package/src/buffer.mjs +73 -0
- package/src/index.mjs +599 -0
- package/test/index.html +443 -0
- package/test/lauch-insecure-chrome +20 -0
- package/test/test.cjs +10 -0
- package/test/test.mjs +59 -0
package/test/index.html
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>@environment-safe/file tests</title>
|
|
5
|
+
<base href="file:///Users/khrome/Development/@environment-safe/file/" target="_blank">
|
|
6
|
+
<link rel="stylesheet" href="./node_modules/mocha/mocha.css">
|
|
7
|
+
<script type="importmap">
|
|
8
|
+
{
|
|
9
|
+
"imports": {
|
|
10
|
+
"express": "./node_modules/@open-automaton/moka/src/stub.mjs",
|
|
11
|
+
"module": "./node_modules/@open-automaton/moka/src/stub.mjs",
|
|
12
|
+
"path": "./node_modules/@open-automaton/moka/src/stub.mjs",
|
|
13
|
+
"fs": "./node_modules/@open-automaton/moka/src/stub.mjs",
|
|
14
|
+
"browser-or-node": "./node_modules/browser-or-node/src/index.js",
|
|
15
|
+
"@babel/cli": "./node_modules/@babel/cli/index.js",
|
|
16
|
+
"@babel/core": "./node_modules/@babel/core/lib/index.js",
|
|
17
|
+
"@babel/plugin-transform-modules-commonjs": "./node_modules/@babel/plugin-transform-modules-commonjs/lib/index.js",
|
|
18
|
+
"@environment-safe/chai": "./node_modules/@environment-safe/chai/src/index.mjs",
|
|
19
|
+
"@open-automaton/moka": "./node_modules/@open-automaton/moka/src/index.mjs",
|
|
20
|
+
"babel-plugin-search-and-replace": "./node_modules/babel-plugin-search-and-replace/lib/index.js",
|
|
21
|
+
"babel-plugin-transform-import-meta": "./node_modules/babel-plugin-transform-import-meta/index.js",
|
|
22
|
+
"chai": "./node_modules/chai/chai.js",
|
|
23
|
+
"eslint": "./node_modules/eslint/lib/api.js",
|
|
24
|
+
"husky": "./node_modules/husky/lib/index.js",
|
|
25
|
+
"mocha": "./node_modules/mocha/index.js",
|
|
26
|
+
"@jridgewell/trace-mapping": "./node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs",
|
|
27
|
+
"commander": "./node_modules/commander/index",
|
|
28
|
+
"convert-source-map": "./node_modules/convert-source-map/index.js",
|
|
29
|
+
"fs-readdir-recursive": "./node_modules/fs-readdir-recursive/index.js",
|
|
30
|
+
"glob": "./node_modules/glob/glob.js",
|
|
31
|
+
"make-dir": "./node_modules/make-dir/index.js",
|
|
32
|
+
"slash": "./node_modules/slash/index.js",
|
|
33
|
+
"@ampproject/remapping": "./node_modules/@ampproject/remapping/dist/remapping.mjs",
|
|
34
|
+
"@babel/code-frame": "./node_modules/@babel/code-frame/lib/index.js",
|
|
35
|
+
"@babel/generator": "./node_modules/@babel/generator/lib/index.js",
|
|
36
|
+
"@babel/helper-compilation-targets": "./node_modules/@babel/helper-compilation-targets/lib/index.js",
|
|
37
|
+
"@babel/helper-module-transforms": "./node_modules/@babel/helper-module-transforms/lib/index.js",
|
|
38
|
+
"@babel/helpers": "./node_modules/@babel/helpers/lib/index.js",
|
|
39
|
+
"@babel/parser": "./node_modules/@babel/parser/lib/index.js",
|
|
40
|
+
"@babel/template": "./node_modules/@babel/template/lib/index.js",
|
|
41
|
+
"@babel/traverse": "./node_modules/@babel/traverse/lib/index.js",
|
|
42
|
+
"@babel/types": "./node_modules/@babel/types/lib/index.js",
|
|
43
|
+
"debug": "./node_modules/debug/src/index.js",
|
|
44
|
+
"gensync": "./node_modules/gensync/index.js",
|
|
45
|
+
"json5": "./node_modules/json5/dist/index.mjs",
|
|
46
|
+
"semver": "./node_modules/semver/index.js",
|
|
47
|
+
"@babel/helper-plugin-utils": "./node_modules/@babel/helper-plugin-utils/lib/index.js",
|
|
48
|
+
"@babel/helper-simple-access": "./node_modules/@babel/helper-simple-access/lib/index.js",
|
|
49
|
+
"@environment-safe/import-introspect": "./node_modules/@environment-safe/import-introspect/index.js",
|
|
50
|
+
"@environment-safe/package": "./node_modules/@environment-safe/package/src/index.mjs",
|
|
51
|
+
"@open-automaton/automaton": "./node_modules/@open-automaton/automaton/src/automaton.js",
|
|
52
|
+
"@open-automaton/cheerio-mining-engine": "./node_modules/@open-automaton/cheerio-mining-engine/src/cheerio.js",
|
|
53
|
+
"@open-automaton/jsdom-mining-engine": "./node_modules/@open-automaton/jsdom-mining-engine/src/jsdom.js",
|
|
54
|
+
"@open-automaton/playwright-mining-engine": "./node_modules/@open-automaton/playwright-mining-engine/src/playwright.js",
|
|
55
|
+
"@open-automaton/puppeteer-mining-engine": "./node_modules/@open-automaton/puppeteer-mining-engine/src/puppeteer.js",
|
|
56
|
+
"detect-browser": "./node_modules/detect-browser/es/index.js",
|
|
57
|
+
"why-is-node-running": "./node_modules/why-is-node-running/index.js",
|
|
58
|
+
"yargs": "./node_modules/yargs/index.mjs",
|
|
59
|
+
"tslib": "./node_modules/tslib/tslib.es6.js",
|
|
60
|
+
"assertion-error": "./node_modules/assertion-error/index",
|
|
61
|
+
"check-error": "./node_modules/check-error/index.js",
|
|
62
|
+
"deep-eql": "./node_modules/deep-eql/index",
|
|
63
|
+
"get-func-name": "./node_modules/get-func-name/index.js",
|
|
64
|
+
"loupe": "./node_modules/loupe/index.js",
|
|
65
|
+
"pathval": "./node_modules/pathval/index.js",
|
|
66
|
+
"type-detect": "./node_modules/type-detect/type-detect.js",
|
|
67
|
+
"@eslint-community/eslint-utils": "./node_modules/@eslint-community/eslint-utils/index.mjs",
|
|
68
|
+
"@eslint-community/regexpp": "./node_modules/@eslint-community/regexpp/index",
|
|
69
|
+
"@eslint/eslintrc": "./node_modules/@eslint/eslintrc/dist/eslintrc.cjs",
|
|
70
|
+
"@eslint/js": "./node_modules/@eslint/js/src/index.js",
|
|
71
|
+
"@humanwhocodes/config-array": "./node_modules/@humanwhocodes/config-array/api.js",
|
|
72
|
+
"@humanwhocodes/module-importer": "./node_modules/@humanwhocodes/module-importer/index.js",
|
|
73
|
+
"@nodelib/fs.walk": "./node_modules/@nodelib/fs.walk/out/index.js",
|
|
74
|
+
"ajv": "./node_modules/ajv/lib/ajv.js",
|
|
75
|
+
"chalk": "./node_modules/chalk/source",
|
|
76
|
+
"cross-spawn": "./node_modules/cross-spawn/index.js",
|
|
77
|
+
"doctrine": "./node_modules/doctrine/lib/doctrine.js",
|
|
78
|
+
"escape-string-regexp": "./node_modules/escape-string-regexp/index.js",
|
|
79
|
+
"eslint-scope": "./node_modules/eslint-scope/dist/eslint-scope.cjs",
|
|
80
|
+
"eslint-visitor-keys": "./node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs",
|
|
81
|
+
"espree": "./node_modules/espree/dist/espree.cjs",
|
|
82
|
+
"esquery": "./node_modules/esquery/dist/esquery.esm.min.js",
|
|
83
|
+
"esutils": "./node_modules/esutils/lib/utils.js",
|
|
84
|
+
"fast-deep-equal": "./node_modules/fast-deep-equal/index.js",
|
|
85
|
+
"file-entry-cache": "./node_modules/file-entry-cache/cache.js",
|
|
86
|
+
"find-up": "./node_modules/find-up/index.js",
|
|
87
|
+
"glob-parent": "./node_modules/glob-parent/index.js",
|
|
88
|
+
"globals": "./node_modules/globals/index.js",
|
|
89
|
+
"graphemer": "./node_modules/graphemer/lib/index.js",
|
|
90
|
+
"ignore": "./node_modules/ignore/index.js",
|
|
91
|
+
"imurmurhash": "./node_modules/imurmurhash/imurmurhash.js",
|
|
92
|
+
"is-glob": "./node_modules/is-glob/index.js",
|
|
93
|
+
"is-path-inside": "./node_modules/is-path-inside/index.js",
|
|
94
|
+
"js-yaml": "./node_modules/js-yaml/dist/js-yaml.mjs",
|
|
95
|
+
"json-stable-stringify-without-jsonify": "./node_modules/json-stable-stringify-without-jsonify/index.js",
|
|
96
|
+
"levn": "./node_modules/levn/lib/",
|
|
97
|
+
"lodash.merge": "./node_modules/lodash.merge/index.js",
|
|
98
|
+
"minimatch": "./node_modules/minimatch/minimatch.js",
|
|
99
|
+
"natural-compare": "./node_modules/natural-compare/index.js",
|
|
100
|
+
"optionator": "./node_modules/optionator/lib/",
|
|
101
|
+
"strip-ansi": "./node_modules/strip-ansi/index.js",
|
|
102
|
+
"text-table": "./node_modules/text-table/index.js",
|
|
103
|
+
"ansi-colors": "./node_modules/ansi-colors/index.js",
|
|
104
|
+
"browser-stdout": "./node_modules/browser-stdout/index.js",
|
|
105
|
+
"chokidar": "./node_modules/chokidar/index.js",
|
|
106
|
+
"diff": "./node_modules/diff/lib/index.es6.js",
|
|
107
|
+
"he": "./node_modules/he/he.js",
|
|
108
|
+
"log-symbols": "./node_modules/log-symbols/index.js",
|
|
109
|
+
"ms": "./node_modules/ms/index",
|
|
110
|
+
"nanoid": "./node_modules/nanoid/index.js",
|
|
111
|
+
"serialize-javascript": "./node_modules/serialize-javascript/index.js",
|
|
112
|
+
"strip-json-comments": "./node_modules/strip-json-comments/index.js",
|
|
113
|
+
"supports-color": "./node_modules/supports-color/index.js",
|
|
114
|
+
"workerpool": "./node_modules/workerpool/src/index.js",
|
|
115
|
+
"yargs-parser": "./node_modules/yargs-parser/index.js",
|
|
116
|
+
"yargs-unparser": "./node_modules/yargs-unparser/index.js",
|
|
117
|
+
"@jridgewell/resolve-uri": "./node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs",
|
|
118
|
+
"@jridgewell/sourcemap-codec": "./node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs",
|
|
119
|
+
"fs.realpath": "./node_modules/fs.realpath/index.js",
|
|
120
|
+
"inflight": "./node_modules/inflight/inflight.js",
|
|
121
|
+
"inherits": "./node_modules/inherits/inherits.js",
|
|
122
|
+
"once": "./node_modules/once/once.js",
|
|
123
|
+
"path-is-absolute": "./node_modules/path-is-absolute/index.js",
|
|
124
|
+
"@jridgewell/gen-mapping": "./node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs",
|
|
125
|
+
"@babel/highlight": "./node_modules/@babel/highlight/lib/index.js",
|
|
126
|
+
"jsesc": "./node_modules/jsesc/jsesc.js",
|
|
127
|
+
"@babel/helper-validator-option": "./node_modules/@babel/helper-validator-option/lib/index.js",
|
|
128
|
+
"browserslist": "./node_modules/browserslist/index.js",
|
|
129
|
+
"lru-cache": "./node_modules/lru-cache/index.js",
|
|
130
|
+
"@babel/helper-environment-visitor": "./node_modules/@babel/helper-environment-visitor/lib/index.js",
|
|
131
|
+
"@babel/helper-module-imports": "./node_modules/@babel/helper-module-imports/lib/index.js",
|
|
132
|
+
"@babel/helper-split-export-declaration": "./node_modules/@babel/helper-split-export-declaration/lib/index.js",
|
|
133
|
+
"@babel/helper-validator-identifier": "./node_modules/@babel/helper-validator-identifier/lib/index.js",
|
|
134
|
+
"@babel/helper-function-name": "./node_modules/@babel/helper-function-name/lib/index.js",
|
|
135
|
+
"@babel/helper-hoist-variables": "./node_modules/@babel/helper-hoist-variables/lib/index.js",
|
|
136
|
+
"@babel/helper-string-parser": "./node_modules/@babel/helper-string-parser/lib/index.js",
|
|
137
|
+
"to-fast-properties": "./node_modules/to-fast-properties/index.js",
|
|
138
|
+
"es-module-lexer": "./node_modules/es-module-lexer/index.js",
|
|
139
|
+
"@open-automaton/automaton-engine": "./node_modules/@open-automaton/automaton-engine/src/automaton-engine.js",
|
|
140
|
+
"async-arrays": "./node_modules/async-arrays/async-arrays.mjs",
|
|
141
|
+
"carlton": "./node_modules/carlton/carlton.js",
|
|
142
|
+
"clone": "./node_modules/clone/clone.js",
|
|
143
|
+
"extended-emitter": "./node_modules/extended-emitter/index.js",
|
|
144
|
+
"html-parser": "./node_modules/html-parser/src/parser.js",
|
|
145
|
+
"libxmljs2": "./node_modules/libxmljs2/index",
|
|
146
|
+
"postman-request": "./node_modules/postman-request/index.js",
|
|
147
|
+
"simple-log-function": "./node_modules/simple-log-function/simple-log-function.js",
|
|
148
|
+
"url-parse": "./node_modules/url-parse/index.js",
|
|
149
|
+
"cheerio": "./node_modules/cheerio/index.js",
|
|
150
|
+
"async-fn-callback": "./node_modules/async-fn-callback/index.js",
|
|
151
|
+
"jsdom": "./node_modules/jsdom/lib/api.js",
|
|
152
|
+
"playwright": "./node_modules/playwright/index.js",
|
|
153
|
+
"puppeteer": "./node_modules/puppeteer/cjs-entry.js",
|
|
154
|
+
"puppeteer-extra": "./node_modules/puppeteer-extra/dist/index.esm.js",
|
|
155
|
+
"puppeteer-extra-plugin-stealth": "./node_modules/puppeteer-extra-plugin-stealth/index.js",
|
|
156
|
+
"siginfo": "./node_modules/siginfo/index.js",
|
|
157
|
+
"stackback": "./node_modules/stackback/index.js",
|
|
158
|
+
"cliui": "./node_modules/cliui/index.js",
|
|
159
|
+
"escalade": "./node_modules/escalade/index.js",
|
|
160
|
+
"get-caller-file": "./node_modules/get-caller-file/index.js",
|
|
161
|
+
"require-directory": "./node_modules/require-directory/index.js",
|
|
162
|
+
"string-width": "./node_modules/string-width/index.js",
|
|
163
|
+
"y18n": "./node_modules/y18n/index.js",
|
|
164
|
+
"import-fresh": "./node_modules/import-fresh/index.js",
|
|
165
|
+
"@humanwhocodes/object-schema": "./node_modules/@humanwhocodes/object-schema/src/index.js",
|
|
166
|
+
"@nodelib/fs.scandir": "./node_modules/@nodelib/fs.scandir/out/index.js",
|
|
167
|
+
"fastq": "./node_modules/fastq/queue.js",
|
|
168
|
+
"fast-json-stable-stringify": "./node_modules/fast-json-stable-stringify/index.js",
|
|
169
|
+
"json-schema-traverse": "./node_modules/json-schema-traverse/index.js",
|
|
170
|
+
"uri-js": "./node_modules/uri-js/dist/es5/uri.all.js",
|
|
171
|
+
"ansi-styles": "./node_modules/ansi-styles/index.js",
|
|
172
|
+
"path-key": "./node_modules/path-key/index.js",
|
|
173
|
+
"shebang-command": "./node_modules/shebang-command/index.js",
|
|
174
|
+
"which": "./node_modules/which/which.js",
|
|
175
|
+
"esrecurse": "./node_modules/esrecurse/esrecurse.js",
|
|
176
|
+
"estraverse": "./node_modules/estraverse/estraverse.js",
|
|
177
|
+
"acorn": "./node_modules/acorn/dist/acorn.mjs",
|
|
178
|
+
"acorn-jsx": "./node_modules/acorn-jsx/index.js",
|
|
179
|
+
"flat-cache": "./node_modules/flat-cache/src/cache.js",
|
|
180
|
+
"locate-path": "./node_modules/locate-path/index.js",
|
|
181
|
+
"path-exists": "./node_modules/path-exists/index.js",
|
|
182
|
+
"is-extglob": "./node_modules/is-extglob/index.js",
|
|
183
|
+
"argparse": "./node_modules/argparse/argparse.js",
|
|
184
|
+
"prelude-ls": "./node_modules/prelude-ls/lib/",
|
|
185
|
+
"type-check": "./node_modules/type-check/lib/",
|
|
186
|
+
"brace-expansion": "./node_modules/brace-expansion/index.js",
|
|
187
|
+
"deep-is": "./node_modules/deep-is/index.js",
|
|
188
|
+
"@aashutoshrathi/word-wrap": "./node_modules/@aashutoshrathi/word-wrap/index.js",
|
|
189
|
+
"fast-levenshtein": "./node_modules/fast-levenshtein/levenshtein.js",
|
|
190
|
+
"ansi-regex": "./node_modules/ansi-regex/index.js",
|
|
191
|
+
"anymatch": "./node_modules/anymatch/index.js",
|
|
192
|
+
"braces": "./node_modules/braces/index.js",
|
|
193
|
+
"is-binary-path": "./node_modules/is-binary-path/index.js",
|
|
194
|
+
"normalize-path": "./node_modules/normalize-path/index.js",
|
|
195
|
+
"readdirp": "./node_modules/readdirp/index.js",
|
|
196
|
+
"is-unicode-supported": "./node_modules/is-unicode-supported/index.js",
|
|
197
|
+
"randombytes": "./node_modules/randombytes/index.js",
|
|
198
|
+
"has-flag": "./node_modules/has-flag/index.js",
|
|
199
|
+
"camelcase": "./node_modules/camelcase/index.js",
|
|
200
|
+
"decamelize": "./node_modules/decamelize/index.js",
|
|
201
|
+
"flat": "./node_modules/flat/index.js",
|
|
202
|
+
"is-plain-obj": "./node_modules/is-plain-obj/index.js",
|
|
203
|
+
"wrappy": "./node_modules/wrappy/wrappy.js",
|
|
204
|
+
"@jridgewell/set-array": "./node_modules/@jridgewell/set-array/dist/set-array.mjs",
|
|
205
|
+
"js-tokens": "./node_modules/js-tokens/index.js",
|
|
206
|
+
"caniuse-lite": "./node_modules/caniuse-lite/dist/unpacker/index.js",
|
|
207
|
+
"electron-to-chromium": "./node_modules/electron-to-chromium/index.js",
|
|
208
|
+
"update-browserslist-db": "./node_modules/update-browserslist-db/index.js",
|
|
209
|
+
"yallist": "./node_modules/yallist/yallist.js",
|
|
210
|
+
"libxmljs": "./node_modules/libxmljs/dist/index.js",
|
|
211
|
+
"sift": "./node_modules/sift/es5m/index.js",
|
|
212
|
+
"es6-template-strings": "./node_modules/es6-template-strings/index.js",
|
|
213
|
+
"@mapbox/node-pre-gyp": "./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js",
|
|
214
|
+
"bindings": "./node_modules/bindings/bindings.js",
|
|
215
|
+
"nan": "./node_modules/nan/include_dirs.js",
|
|
216
|
+
"@postman/form-data": "./node_modules/@postman/form-data/lib/form_data",
|
|
217
|
+
"@postman/tough-cookie": "./node_modules/@postman/tough-cookie/lib/cookie",
|
|
218
|
+
"@postman/tunnel-agent": "./node_modules/@postman/tunnel-agent/index.js",
|
|
219
|
+
"aws-sign2": "./node_modules/aws-sign2/index.js",
|
|
220
|
+
"aws4": "./node_modules/aws4/aws4.js",
|
|
221
|
+
"brotli": "./node_modules/brotli/index.js",
|
|
222
|
+
"caseless": "./node_modules/caseless/index.js",
|
|
223
|
+
"combined-stream": "./node_modules/combined-stream/lib/combined_stream",
|
|
224
|
+
"extend": "./node_modules/extend/index",
|
|
225
|
+
"forever-agent": "./node_modules/forever-agent/index.js",
|
|
226
|
+
"har-validator": "./node_modules/har-validator/lib/promise.js",
|
|
227
|
+
"http-signature": "./node_modules/http-signature/lib/index.js",
|
|
228
|
+
"is-typedarray": "./node_modules/is-typedarray/index.js",
|
|
229
|
+
"isstream": "./node_modules/isstream/isstream.js",
|
|
230
|
+
"json-stringify-safe": "./node_modules/json-stringify-safe/stringify.js",
|
|
231
|
+
"mime-types": "./node_modules/mime-types/index.js",
|
|
232
|
+
"oauth-sign": "./node_modules/oauth-sign/index.js",
|
|
233
|
+
"performance-now": "./node_modules/performance-now/lib/performance-now.js",
|
|
234
|
+
"qs": "./node_modules/qs/lib/index.js",
|
|
235
|
+
"safe-buffer": "./node_modules/safe-buffer/index.js",
|
|
236
|
+
"stream-length": "./node_modules/stream-length/index.js",
|
|
237
|
+
"uuid": "./node_modules/uuid/dist/esm-node/index.js",
|
|
238
|
+
"loglevel": "./node_modules/loglevel/lib/loglevel.js",
|
|
239
|
+
"querystringify": "./node_modules/querystringify/index.js",
|
|
240
|
+
"requires-port": "./node_modules/requires-port/index.js",
|
|
241
|
+
"cheerio-select": "./node_modules/cheerio-select/index.js",
|
|
242
|
+
"dom-serializer": "./node_modules/dom-serializer/index.js",
|
|
243
|
+
"domhandler": "./node_modules/domhandler/index.js",
|
|
244
|
+
"domutils": "./node_modules/domutils/index.js",
|
|
245
|
+
"htmlparser2": "./node_modules/htmlparser2/index.js",
|
|
246
|
+
"parse5": "./node_modules/parse5/index.js",
|
|
247
|
+
"parse5-htmlparser2-tree-adapter": "./node_modules/parse5-htmlparser2-tree-adapter/index.js",
|
|
248
|
+
"abab": "./node_modules/abab/index.js",
|
|
249
|
+
"acorn-globals": "./node_modules/acorn-globals/index.js",
|
|
250
|
+
"cssom": "./node_modules/cssom/lib/index.js",
|
|
251
|
+
"cssstyle": "./node_modules/cssstyle/lib/CSSStyleDeclaration.js",
|
|
252
|
+
"data-urls": "./node_modules/data-urls/lib/parser.js",
|
|
253
|
+
"decimal.js": "./node_modules/decimal.js/decimal.mjs",
|
|
254
|
+
"domexception": "./node_modules/domexception/index.js",
|
|
255
|
+
"escodegen": "./node_modules/escodegen/escodegen.js",
|
|
256
|
+
"form-data": "./node_modules/form-data/lib/form_data",
|
|
257
|
+
"html-encoding-sniffer": "./node_modules/html-encoding-sniffer/lib/html-encoding-sniffer.js",
|
|
258
|
+
"http-proxy-agent": "./node_modules/http-proxy-agent/dist/index.js",
|
|
259
|
+
"https-proxy-agent": "./node_modules/https-proxy-agent/dist/index",
|
|
260
|
+
"is-potential-custom-element-name": "./node_modules/is-potential-custom-element-name/index.js",
|
|
261
|
+
"nwsapi": "./node_modules/nwsapi/src/nwsapi",
|
|
262
|
+
"saxes": "./node_modules/saxes/saxes.js",
|
|
263
|
+
"symbol-tree": "./node_modules/symbol-tree/lib/SymbolTree.js",
|
|
264
|
+
"tough-cookie": "./node_modules/tough-cookie/lib/cookie",
|
|
265
|
+
"w3c-hr-time": "./node_modules/w3c-hr-time/index.js",
|
|
266
|
+
"w3c-xmlserializer": "./node_modules/w3c-xmlserializer/lib/serialize.js",
|
|
267
|
+
"webidl-conversions": "./node_modules/webidl-conversions/lib/index.js",
|
|
268
|
+
"whatwg-encoding": "./node_modules/whatwg-encoding/lib/whatwg-encoding.js",
|
|
269
|
+
"whatwg-mimetype": "./node_modules/whatwg-mimetype/lib/mime-type.js",
|
|
270
|
+
"whatwg-url": "./node_modules/whatwg-url/index.js",
|
|
271
|
+
"ws": "./node_modules/ws/index.js",
|
|
272
|
+
"xml-name-validator": "./node_modules/xml-name-validator/lib/xml-name-validator.js",
|
|
273
|
+
"playwright-core": "./node_modules/playwright-core/index.js",
|
|
274
|
+
"cross-fetch": "./node_modules/cross-fetch/dist/node-ponyfill.js",
|
|
275
|
+
"extract-zip": "./node_modules/extract-zip/index.js",
|
|
276
|
+
"pkg-dir": "./node_modules/pkg-dir/index.js",
|
|
277
|
+
"progress": "./node_modules/progress/index.js",
|
|
278
|
+
"proxy-from-env": "./node_modules/proxy-from-env/index.js",
|
|
279
|
+
"rimraf": "./node_modules/rimraf/rimraf.js",
|
|
280
|
+
"tar-fs": "./node_modules/tar-fs/index.js",
|
|
281
|
+
"unbzip2-stream": "./node_modules/unbzip2-stream/index.js",
|
|
282
|
+
"deepmerge": "./node_modules/deepmerge/dist/cjs.js",
|
|
283
|
+
"puppeteer-extra-plugin": "./node_modules/puppeteer-extra-plugin/dist/index.esm.js",
|
|
284
|
+
"puppeteer-extra-plugin-user-preferences": "./node_modules/puppeteer-extra-plugin-user-preferences/index.js",
|
|
285
|
+
"wrap-ansi": "./node_modules/wrap-ansi/index.js",
|
|
286
|
+
"emoji-regex": "./node_modules/emoji-regex/index.js",
|
|
287
|
+
"is-fullwidth-code-point": "./node_modules/is-fullwidth-code-point/index.js",
|
|
288
|
+
"parent-module": "./node_modules/parent-module/index.js",
|
|
289
|
+
"resolve-from": "./node_modules/resolve-from/index.js",
|
|
290
|
+
"@nodelib/fs.stat": "./node_modules/@nodelib/fs.stat/out/index.js",
|
|
291
|
+
"run-parallel": "./node_modules/run-parallel/index.js",
|
|
292
|
+
"reusify": "./node_modules/reusify/reusify.js",
|
|
293
|
+
"color-convert": "./node_modules/color-convert/index.js",
|
|
294
|
+
"shebang-regex": "./node_modules/shebang-regex/index.js",
|
|
295
|
+
"isexe": "./node_modules/isexe/index.js",
|
|
296
|
+
"flatted": "./node_modules/flatted/esm/index.js",
|
|
297
|
+
"keyv": "./node_modules/keyv/src/index.js",
|
|
298
|
+
"p-locate": "./node_modules/p-locate/index.js",
|
|
299
|
+
"balanced-match": "./node_modules/balanced-match/index.js",
|
|
300
|
+
"picomatch": "./node_modules/picomatch/index.js",
|
|
301
|
+
"fill-range": "./node_modules/fill-range/index.js",
|
|
302
|
+
"binary-extensions": "./node_modules/binary-extensions/index.js",
|
|
303
|
+
"picocolors": "./node_modules/picocolors/picocolors.js",
|
|
304
|
+
"es5-ext": "./node_modules/es5-ext/index.js",
|
|
305
|
+
"esniff": "./node_modules/esniff/index.js",
|
|
306
|
+
"detect-libc": "./node_modules/detect-libc/lib/detect-libc.js",
|
|
307
|
+
"node-fetch": "./node_modules/node-fetch/lib/index.mjs",
|
|
308
|
+
"nopt": "./node_modules/nopt/lib/nopt.js",
|
|
309
|
+
"npmlog": "./node_modules/npmlog/log.js",
|
|
310
|
+
"tar": "./node_modules/tar/index.js",
|
|
311
|
+
"asynckit": "./node_modules/asynckit/index.js",
|
|
312
|
+
"psl": "./node_modules/psl/index.js",
|
|
313
|
+
"universalify": "./node_modules/universalify/index.js",
|
|
314
|
+
"base64-js": "./node_modules/base64-js/index.js",
|
|
315
|
+
"delayed-stream": "./node_modules/delayed-stream/lib/delayed_stream",
|
|
316
|
+
"har-schema": "./node_modules/har-schema/lib/index.js",
|
|
317
|
+
"assert-plus": "./node_modules/assert-plus/assert.js",
|
|
318
|
+
"jsprim": "./node_modules/jsprim/lib/jsprim.js",
|
|
319
|
+
"sshpk": "./node_modules/sshpk/lib/index.js",
|
|
320
|
+
"mime-db": "./node_modules/mime-db/index.js",
|
|
321
|
+
"side-channel": "./node_modules/side-channel/index.js",
|
|
322
|
+
"bluebird": "./node_modules/bluebird/js/main/bluebird.js",
|
|
323
|
+
"boolbase": "./node_modules/boolbase/index.js",
|
|
324
|
+
"css-select": "./node_modules/css-select/index.js",
|
|
325
|
+
"css-what": "./node_modules/css-what/lib/es/index.js",
|
|
326
|
+
"domelementtype": "./node_modules/domelementtype/index.js",
|
|
327
|
+
"entities": "./node_modules/entities/index.js",
|
|
328
|
+
"acorn-walk": "./node_modules/acorn-walk/dist/walk.mjs",
|
|
329
|
+
"esprima": "./node_modules/esprima/dist/esprima.js",
|
|
330
|
+
"@tootallnate/once": "./node_modules/@tootallnate/once/dist/index.js",
|
|
331
|
+
"agent-base": "./node_modules/agent-base/dist/src/index",
|
|
332
|
+
"xmlchars": "./node_modules/xmlchars/xmlchars.js",
|
|
333
|
+
"browser-process-hrtime": "./node_modules/browser-process-hrtime/index.js",
|
|
334
|
+
"iconv-lite": "./node_modules/iconv-lite/lib/index.js",
|
|
335
|
+
"tr46": "./node_modules/tr46/index.js",
|
|
336
|
+
"get-stream": "./node_modules/get-stream/index.js",
|
|
337
|
+
"yauzl": "./node_modules/yauzl/index.js",
|
|
338
|
+
"chownr": "./node_modules/chownr/chownr.js",
|
|
339
|
+
"mkdirp-classic": "./node_modules/mkdirp-classic/index.js",
|
|
340
|
+
"pump": "./node_modules/pump/index.js",
|
|
341
|
+
"tar-stream": "./node_modules/tar-stream/index.js",
|
|
342
|
+
"through": "./node_modules/through/index.js",
|
|
343
|
+
"merge-deep": "./node_modules/merge-deep/index.js",
|
|
344
|
+
"puppeteer-extra-plugin-user-data-dir": "./node_modules/puppeteer-extra-plugin-user-data-dir/index.js",
|
|
345
|
+
"callsites": "./node_modules/callsites/index.js",
|
|
346
|
+
"queue-microtask": "./node_modules/queue-microtask/index.js",
|
|
347
|
+
"color-name": "./node_modules/color-name/index.js",
|
|
348
|
+
"json-buffer": "./node_modules/json-buffer/index.js",
|
|
349
|
+
"p-limit": "./node_modules/p-limit/index.js",
|
|
350
|
+
"to-regex-range": "./node_modules/to-regex-range/index.js",
|
|
351
|
+
"es6-iterator": "./node_modules/es6-iterator/index.js",
|
|
352
|
+
"es6-symbol": "./node_modules/es6-symbol/index.js",
|
|
353
|
+
"next-tick": "./node_modules/next-tick/index.js",
|
|
354
|
+
"d": "./node_modules/d/index.js",
|
|
355
|
+
"abbrev": "./node_modules/abbrev/abbrev.js",
|
|
356
|
+
"are-we-there-yet": "./node_modules/are-we-there-yet/lib/index.js",
|
|
357
|
+
"console-control-strings": "./node_modules/console-control-strings/index.js",
|
|
358
|
+
"gauge": "./node_modules/gauge/index.js",
|
|
359
|
+
"set-blocking": "./node_modules/set-blocking/index.js",
|
|
360
|
+
"fs-minipass": "./node_modules/fs-minipass/index.js",
|
|
361
|
+
"minipass": "./node_modules/minipass/index.mjs",
|
|
362
|
+
"minizlib": "./node_modules/minizlib/index.js",
|
|
363
|
+
"mkdirp": "./node_modules/mkdirp/index.js",
|
|
364
|
+
"extsprintf": "./node_modules/extsprintf/lib/extsprintf.js",
|
|
365
|
+
"json-schema": "./node_modules/json-schema/lib/validate.js",
|
|
366
|
+
"verror": "./node_modules/verror/lib/verror.js",
|
|
367
|
+
"asn1": "./node_modules/asn1/lib/index.js",
|
|
368
|
+
"dashdash": "./node_modules/dashdash/lib/dashdash.js",
|
|
369
|
+
"getpass": "./node_modules/getpass/lib/index.js",
|
|
370
|
+
"safer-buffer": "./node_modules/safer-buffer/safer.js",
|
|
371
|
+
"jsbn": "./node_modules/jsbn/index.js",
|
|
372
|
+
"tweetnacl": "./node_modules/tweetnacl/nacl-fast.js",
|
|
373
|
+
"ecc-jsbn": "./node_modules/ecc-jsbn/index.js",
|
|
374
|
+
"bcrypt-pbkdf": "./node_modules/bcrypt-pbkdf/index.js",
|
|
375
|
+
"call-bind": "./node_modules/call-bind/index.js",
|
|
376
|
+
"get-intrinsic": "./node_modules/get-intrinsic/index.js",
|
|
377
|
+
"object-inspect": "./node_modules/object-inspect/index.js",
|
|
378
|
+
"nth-check": "./node_modules/nth-check/index.js",
|
|
379
|
+
"fd-slicer": "./node_modules/fd-slicer/index.js",
|
|
380
|
+
"buffer-crc32": "./node_modules/buffer-crc32/index.js",
|
|
381
|
+
"end-of-stream": "./node_modules/end-of-stream/index.js",
|
|
382
|
+
"bl": "./node_modules/bl/bl.js",
|
|
383
|
+
"fs-constants": "./node_modules/fs-constants/index.js",
|
|
384
|
+
"readable-stream": "./node_modules/readable-stream/readable.js",
|
|
385
|
+
"arr-union": "./node_modules/arr-union/index.js",
|
|
386
|
+
"clone-deep": "./node_modules/clone-deep/index.js",
|
|
387
|
+
"kind-of": "./node_modules/kind-of/index.js",
|
|
388
|
+
"fs-extra": "./node_modules/fs-extra/lib/index.js",
|
|
389
|
+
"yocto-queue": "./node_modules/yocto-queue/index.js",
|
|
390
|
+
"is-number": "./node_modules/is-number/index.js",
|
|
391
|
+
"delegates": "./node_modules/delegates/index.js",
|
|
392
|
+
"aproba": "./node_modules/aproba/index.js",
|
|
393
|
+
"color-support": "./node_modules/color-support/index.js",
|
|
394
|
+
"has-unicode": "./node_modules/has-unicode/index.js",
|
|
395
|
+
"object-assign": "./node_modules/object-assign/index.js",
|
|
396
|
+
"signal-exit": "./node_modules/signal-exit/index.js",
|
|
397
|
+
"wide-align": "./node_modules/wide-align/align.js",
|
|
398
|
+
"core-util-is": "./node_modules/core-util-is/lib/util.js",
|
|
399
|
+
"function-bind": "./node_modules/function-bind/index",
|
|
400
|
+
"has": "./node_modules/has/src",
|
|
401
|
+
"has-proto": "./node_modules/has-proto/index.js",
|
|
402
|
+
"has-symbols": "./node_modules/has-symbols/index.js",
|
|
403
|
+
"pend": "./node_modules/pend/index.js",
|
|
404
|
+
"util-deprecate": "./node_modules/util-deprecate/node.js",
|
|
405
|
+
"for-own": "./node_modules/for-own/index.js",
|
|
406
|
+
"is-plain-object": "./node_modules/is-plain-object/index.js",
|
|
407
|
+
"lazy-cache": "./node_modules/lazy-cache/index.js",
|
|
408
|
+
"shallow-clone": "./node_modules/shallow-clone/index.js",
|
|
409
|
+
"is-buffer": "./node_modules/is-buffer/index.js",
|
|
410
|
+
"graceful-fs": "./node_modules/graceful-fs/graceful-fs.js",
|
|
411
|
+
"jsonfile": "./node_modules/jsonfile/index.js",
|
|
412
|
+
"for-in": "./node_modules/for-in/index.js",
|
|
413
|
+
"isobject": "./node_modules/isobject/index.js",
|
|
414
|
+
"is-extendable": "./node_modules/is-extendable/index.js",
|
|
415
|
+
"mixin-object": "./node_modules/mixin-object/index.js"
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
</script>
|
|
419
|
+
</head>
|
|
420
|
+
<body>
|
|
421
|
+
<div id="mocha"></div>
|
|
422
|
+
<script type=module>
|
|
423
|
+
import { detect } from 'detect-browser';
|
|
424
|
+
const browser = detect();
|
|
425
|
+
if((browser && (
|
|
426
|
+
browser.name === 'safari' &&
|
|
427
|
+
parseInt(browser.version) < 16
|
|
428
|
+
)) || !browser){
|
|
429
|
+
throw new Error('Safari < 16.4 not supported!');
|
|
430
|
+
}
|
|
431
|
+
</script>
|
|
432
|
+
<script src="./node_modules/mocha/mocha.js"></script>
|
|
433
|
+
<script>mocha.setup('bdd')</script>
|
|
434
|
+
<script type="module" src="./test/test.mjs"></script>
|
|
435
|
+
<script type="module">
|
|
436
|
+
mocha.checkLeaks();
|
|
437
|
+
mocha.globals([]);
|
|
438
|
+
mocha.run();
|
|
439
|
+
</script>
|
|
440
|
+
|
|
441
|
+
</body>
|
|
442
|
+
</html>
|
|
443
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|
3
|
+
# ...
|
|
4
|
+
google-chrome --allow-file-access-from-files
|
|
5
|
+
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
|
6
|
+
# Mac OSX
|
|
7
|
+
open -a 'Google Chrome' --args -allow-file-access-from-files
|
|
8
|
+
elif [[ "$OSTYPE" == "cygwin" ]]; then
|
|
9
|
+
# POSIX compatibility layer and Linux environment emulation for Windows
|
|
10
|
+
google-chrome --allow-file-access-from-files
|
|
11
|
+
elif [[ "$OSTYPE" == "msys" ]]; then
|
|
12
|
+
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
|
|
13
|
+
C:\ ... \Application\chrome.exe --allow-file-access-from-files
|
|
14
|
+
elif [[ "$OSTYPE" == "win32" ]]; then
|
|
15
|
+
# I'm not sure this can happen.
|
|
16
|
+
C:\ ... \Application\chrome.exe --allow-file-access-from-files
|
|
17
|
+
elif [[ "$OSTYPE" == "freebsd"* ]]; then
|
|
18
|
+
# ...
|
|
19
|
+
google-chrome --allow-file-access-from-files
|
|
20
|
+
fi
|
package/test/test.cjs
ADDED
package/test/test.mjs
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* global describe:false */
|
|
2
|
+
import { chai } from '@environment-safe/chai';
|
|
3
|
+
import { it } from '@open-automaton/moka';
|
|
4
|
+
import { File } from '../src/index.mjs';
|
|
5
|
+
const should = chai.should();
|
|
6
|
+
|
|
7
|
+
describe('module', ()=>{
|
|
8
|
+
describe('performs a simple test suite', ()=>{
|
|
9
|
+
const fileName = 'file' + Math.floor( Math.random() * 1000000 );
|
|
10
|
+
//*
|
|
11
|
+
it(`creates, saves, loads & deletes ${fileName}`, async function(){
|
|
12
|
+
this.timeout(20000);
|
|
13
|
+
should.exist(File);
|
|
14
|
+
const file = new File(fileName, {
|
|
15
|
+
directory: 'documents',
|
|
16
|
+
cache: true
|
|
17
|
+
});
|
|
18
|
+
(await File.exists(file.path, file.directory)).should.equal(false);
|
|
19
|
+
await file.body('{}').save();
|
|
20
|
+
(await File.exists(file.path, file.directory)).should.equal(true);
|
|
21
|
+
await file.body('{"foo":"bar"}').save();
|
|
22
|
+
const newFile = new File(fileName, {
|
|
23
|
+
directory: 'documents',
|
|
24
|
+
cache: true
|
|
25
|
+
});
|
|
26
|
+
const body = (await newFile.load()).body();
|
|
27
|
+
const str = body.cast('string');
|
|
28
|
+
str.should.equal('{"foo":"bar"}');
|
|
29
|
+
await file.delete();
|
|
30
|
+
}); //*/
|
|
31
|
+
|
|
32
|
+
it('lists file in user\'s documents dir', async function(){
|
|
33
|
+
//assumes you have some file in your documents directory
|
|
34
|
+
const list = await File.list('documents', {
|
|
35
|
+
files: true,
|
|
36
|
+
directories: false
|
|
37
|
+
});
|
|
38
|
+
should.exist(list);
|
|
39
|
+
const file = new File(list[0], {directory: 'documents'});
|
|
40
|
+
await file.load();
|
|
41
|
+
file.body().cast('string').length.should.be.above(1);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('loads an implicit, relative URL', async function(){
|
|
45
|
+
const file = new File('test/index.html');
|
|
46
|
+
await file.load();
|
|
47
|
+
const titleMatches = file.body().cast('string').match(/@environment-safe\/file/);
|
|
48
|
+
should.exist(titleMatches);
|
|
49
|
+
titleMatches.length.should.equal(1);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('loads an explicit, relative URL', async function(){
|
|
53
|
+
const file = new File('README.md', {directory: './node_modules/@environment-safe/chai'});
|
|
54
|
+
await file.load();
|
|
55
|
+
file.body().cast('string').length.should.be.above(1);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|