Example works
This commit is contained in:
commit
690bca781f
7 changed files with 458 additions and 0 deletions
36
examples/index.html
Normal file
36
examples/index.html
Normal file
|
@ -0,0 +1,36 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<title>Browser Tar</title>
|
||||
|
||||
<script src='../node_modules/require-kiss/require-kiss.js'></script>
|
||||
<script src='../lib/utils.js'></script>
|
||||
<script src='../lib/header.js'></script>
|
||||
<script src='../lib/tar.js'></script>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var Tar = require('tar'),
|
||||
utils = require('utils'),
|
||||
tape = new Tar(),
|
||||
out,
|
||||
url,
|
||||
base64;
|
||||
|
||||
out = tape.append('output.txt', 'This is test1!');
|
||||
out = tape.append('dir/out.txt', 'This is test2! I changed up the directory');
|
||||
out = tape.append('arr.txt', utils.stringToUint8('This is a Uint8Array!'));
|
||||
|
||||
base64 = utils.uint8ToBase64(out);
|
||||
|
||||
url = "data:application/tar;base64," + base64;
|
||||
window.open(url);
|
||||
}());
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue