Skip to content

Commit 277c5dc

Browse files
committed
fix: debug mode setup and docs
1 parent ea84a0a commit 277c5dc

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,22 @@ will be created with the necessary fs APIs.
2222
* The fs apis have compatibility with nodejs like fs APIs.
2323
See filer docs for API docs: https://filer.js.org/
2424

25-
```js
26-
// using CDN link in your html file
25+
```html
26+
<!--// using CDN link in your html file-->
2727
<script src="https://unpkg.com/@phcode/fs@latest/dist/virtualfs.js"/>
2828
29-
// OR to get a particular version, change latest to the version you need:
29+
<!--// OR to get a particular version, change latest to the version you need:-->
3030
<script src="https://unpkg.com/@phcode/[email protected]/dist/virtualfs.js"/>
3131
32-
// OR if you did npm install
32+
<!--// OR if you did npm install-->
3333
<script src="<project_root>/node_modules/@phcode/fs/dist/virtualfs.js"/>
34+
35+
<!--If you want to enable debug mode add this before the import script line-->
36+
<script type="text/javascript">
37+
window.debugMode = true; // if you want to enable debug mode
38+
// alternatively set your URL query string parameter, https://yoursite?debugMode=true
39+
</script>
40+
3441
```
3542

3643
### Usage in web-worker in browser

dist/virtualfs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/virtualfs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/virtualfs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ globalObject.Filer = Filer;
3131
globalObject.buffer = buffer;
3232
globalObject.virtualfs = {
3333
urlParams : urlParams,
34-
debugMode : urlParams.get('debug'),
34+
debugMode : globalObject.debugMode || urlParams.get('debug') === 'true',
3535
env: env
3636
};
3737

0 commit comments

Comments
 (0)