Skip to content

Commit

Permalink
feat: test demo
Browse files Browse the repository at this point in the history
  • Loading branch information
hughfenghen committed May 20, 2024
1 parent ce79a2f commit 535324d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
27 changes: 27 additions & 0 deletions demo/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OPFS Tools</title>
<style>
.tip {
font-style: italic;
}

#status {
color: red;
}
</style>
</head>

<body>
<script src="https://cdn.jsdelivr.net/npm/opfs-tools-explorer"></script>
<script>
OTExplorer.init();
</script>
<script src="./test.ts" type="module"></script>
</body>

</html>
10 changes: 10 additions & 0 deletions demo/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { tmpfile, write } from '../src';

console.log(111, localStorage.getItem('OPFS_TOOLS_EXPIRES_TMP_FILES'));
const f = tmpfile();
console.log(222, f.path);
await write(f, '111111111');

await write('/.opfs-tools-temp-dir/xxx', '2222');

export {};

0 comments on commit 535324d

Please sign in to comment.